@@ -412,6 +412,36 @@ describe('layout-gap directive', () => {
412412 expectEl ( nodes [ 1 ] ) . toHaveStyle ( { 'margin-bottom' : '24px' } , styler ) ;
413413 expectEl ( nodes [ 2 ] ) . not . toHaveStyle ( { 'margin-bottom' : '*' } , styler ) ;
414414 } ) ;
415+
416+ it ( 'should work with responsive fxHide' , ( ) => {
417+ let template = `
418+ <div fxLayoutAlign="center center" fxLayoutGap="13px">
419+ <div fxFlex="15" class="sec1" fxFlex.xs="55"></div>
420+ <div fxFlex="30" class="sec2" fxFlex.sm></div>
421+ <div fxFlex="55" class="sec3" fxShow fxHide.sm></div>
422+ </div>
423+ ` ;
424+ createTestComponent ( template ) ;
425+ fixture . detectChanges ( ) ;
426+
427+ let nodes = queryFor ( fixture , '[fxFlex]' ) ;
428+ expect ( nodes . length ) . toEqual ( 3 ) ;
429+ expectEl ( nodes [ 0 ] ) . toHaveStyle ( { 'margin-right' : '13px' } , styler ) ;
430+ expectEl ( nodes [ 1 ] ) . toHaveStyle ( { 'margin-right' : '13px' } , styler ) ;
431+ expectEl ( nodes [ 2 ] ) . not . toHaveStyle ( { 'margin-right' : '*' } , styler ) ;
432+
433+ matchMedia . activate ( 'sm' ) ;
434+ fixture . detectChanges ( ) ;
435+ expectEl ( nodes [ 0 ] ) . toHaveStyle ( { 'margin-right' : '13px' } , styler ) ;
436+ expectEl ( nodes [ 1 ] ) . not . toHaveStyle ( { 'margin-right' : '*' } , styler ) ;
437+ expectEl ( nodes [ 2 ] ) . not . toHaveStyle ( { 'margin-right' : '*' } , styler ) ;
438+
439+ matchMedia . activate ( 'lg' ) ;
440+ fixture . detectChanges ( ) ;
441+ expectEl ( nodes [ 0 ] ) . toHaveStyle ( { 'margin-right' : '13px' } , styler ) ;
442+ expectEl ( nodes [ 1 ] ) . toHaveStyle ( { 'margin-right' : '13px' } , styler ) ;
443+ expectEl ( nodes [ 2 ] ) . not . toHaveStyle ( { 'margin-right' : '*' } , styler ) ;
444+ } ) ;
415445 } ) ;
416446
417447 describe ( 'rtl support' , ( ) => {
0 commit comments