File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
projects/igniteui-angular/src/lib/toast Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -132,8 +132,22 @@ describe('IgxToast', () => {
132
132
expect ( toast . onShown . emit ) . toHaveBeenCalledTimes ( 1 ) ;
133
133
expect ( toast . onHiding . emit ) . toHaveBeenCalledTimes ( 1 ) ;
134
134
expect ( toast . onHidden . emit ) . toHaveBeenCalledTimes ( 1 ) ;
135
-
136
135
} ) ;
136
+
137
+ it ( 'can set message through show method' , fakeAsync ( ( ) => {
138
+ toast . displayTime = 100 ;
139
+ toast . autoHide = false ;
140
+
141
+ toast . show ( 'Custom Message' ) ;
142
+ tick ( 100 ) ;
143
+ fixture . detectChanges ( ) ;
144
+
145
+ expect ( toast . isVisible ) . toBeTruthy ( ) ;
146
+ expect ( toast . animationState ) . toBe ( 'visible' ) ;
147
+ expect ( toast . autoHide ) . toBeFalsy ( ) ;
148
+ expect ( toast . toastMessage ) . toBe ( 'Custom Message' ) ;
149
+ expect ( fixture . nativeElement . querySelector ( 'igx-toast:first-child' ) . innerText ) . toBe ( 'Custom Message' ) ;
150
+ } ) ) ;
137
151
} ) ;
138
152
139
153
@Component ( {
You can’t perform that action at this time.
0 commit comments