@@ -46,6 +46,14 @@ describe('MatGridList', () => {
46
46
} ) . not . toThrow ( ) ;
47
47
} ) ;
48
48
49
+ it ( 'should preserve value when zero is set as row height' , ( ) => {
50
+ const fixture = createComponent ( GridListWithUnspecifiedRowHeight ) ;
51
+ const gridList = fixture . debugElement . query ( By . directive ( MatGridList ) ) . componentInstance ;
52
+
53
+ gridList . rowHeight = 0 ;
54
+ expect ( gridList . rowHeight ) . toBe ( '0' ) ;
55
+ } ) ;
56
+
49
57
it ( 'should set the columns to zero if a negative number is passed in' , ( ) => {
50
58
const fixture = createComponent ( GridListWithDynamicCols ) ;
51
59
fixture . detectChanges ( ) ;
@@ -139,6 +147,24 @@ describe('MatGridList', () => {
139
147
expect ( getStyle ( tiles [ 2 ] , 'top' ) ) . toBe ( '101px' ) ;
140
148
} ) ;
141
149
150
+ it ( 'should be able to set the gutter size to zero' , ( ) => {
151
+ const fixture = createComponent ( GridListWithUnspecifiedGutterSize ) ;
152
+ const gridList = fixture . debugElement . query ( By . directive ( MatGridList ) ) ;
153
+
154
+ gridList . componentInstance . gutterSize = 0 ;
155
+ fixture . detectChanges ( ) ;
156
+
157
+ const tiles = fixture . debugElement . queryAll ( By . css ( 'mat-grid-tile' ) ) ;
158
+
159
+ // check horizontal gutter
160
+ expect ( getStyle ( tiles [ 0 ] , 'width' ) ) . toBe ( '100px' ) ;
161
+ expect ( getComputedLeft ( tiles [ 1 ] ) ) . toBe ( 100 ) ;
162
+
163
+ // check vertical gutter
164
+ expect ( getStyle ( tiles [ 0 ] , 'height' ) ) . toBe ( '100px' ) ;
165
+ expect ( getStyle ( tiles [ 2 ] , 'top' ) ) . toBe ( '100px' ) ;
166
+ } ) ;
167
+
142
168
it ( 'should lay out the tiles correctly for a nested grid list' , ( ) => {
143
169
const fixture = createComponent ( NestedGridList ) ;
144
170
fixture . detectChanges ( ) ;
0 commit comments