@@ -108,6 +108,33 @@ describe('IgxButton', () => {
108108 verifyDisplayDensity ( fabButton , fabButtonDOM , 'fab' , DisplayDensity . cosy ) ;
109109 verifyDisplayDensity ( iconButton , iconButtonDOM , 'icon' , DisplayDensity . cosy ) ;
110110 } ) ;
111+
112+ it ( 'Should set the correct CSS class on the element using the "type" input' , ( ) => {
113+ const fixture = TestBed . createComponent ( InitButtonComponent ) ;
114+ fixture . detectChanges ( ) ;
115+ const theButton = fixture . componentInstance . button ;
116+ const theButtonNativeEl = theButton . nativeElement ;
117+
118+ theButton . type = 'raised' ;
119+ fixture . detectChanges ( ) ;
120+ expect ( theButtonNativeEl . classList ) . toEqual ( 'igx-button--raised' ) ;
121+
122+ theButton . type = 'outlined' ;
123+ fixture . detectChanges ( ) ;
124+ expect ( theButtonNativeEl . classList ) . toEqual ( 'igx-button--outlined' ) ;
125+
126+ theButton . type = 'fab' ;
127+ fixture . detectChanges ( ) ;
128+ expect ( theButtonNativeEl . classList ) . toEqual ( 'igx-button--fab' ) ;
129+
130+ theButton . type = 'icon' ;
131+ fixture . detectChanges ( ) ;
132+ expect ( theButtonNativeEl . classList ) . toEqual ( 'igx-button--icon' ) ;
133+
134+ theButton . type = 'flat' ;
135+ fixture . detectChanges ( ) ;
136+ expect ( theButtonNativeEl . classList ) . toEqual ( 'igx-button--flat' ) ;
137+ } ) ;
111138} ) ;
112139
113140@Component ( {
@@ -117,6 +144,8 @@ describe('IgxButton', () => {
117144 </span>`
118145} )
119146class InitButtonComponent {
147+ @ViewChild ( IgxButtonDirective , { read : IgxButtonDirective } )
148+ button : IgxButtonDirective ;
120149}
121150
122151@Component ( {
0 commit comments