@@ -46,6 +46,14 @@ describe('MatGridList', () => {
4646 } ) . not . toThrow ( ) ;
4747 } ) ;
4848
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+
4957 it ( 'should set the columns to zero if a negative number is passed in' , ( ) => {
5058 const fixture = createComponent ( GridListWithDynamicCols ) ;
5159 fixture . detectChanges ( ) ;
@@ -139,6 +147,24 @@ describe('MatGridList', () => {
139147 expect ( getStyle ( tiles [ 2 ] , 'top' ) ) . toBe ( '101px' ) ;
140148 } ) ;
141149
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+
142168 it ( 'should lay out the tiles correctly for a nested grid list' , ( ) => {
143169 const fixture = createComponent ( NestedGridList ) ;
144170 fixture . detectChanges ( ) ;
0 commit comments