File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
projects/igniteui-angular/src/lib/toast Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -42,14 +42,20 @@ describe('IgxToast', () => {
42
42
expect ( toast . element . id ) . toContain ( 'customToast' ) ;
43
43
} ) ;
44
44
45
- it ( 'should properly toggle' , fakeAsync ( ( ) => {
46
- // spyOn(toast.isVisibleChange, 'emit').and.callThrough();
45
+ it ( 'should properly toggle and emit isVisibleChange ' , fakeAsync ( ( ) => {
46
+ spyOn ( toast . isVisibleChange , 'emit' ) . and . callThrough ( ) ;
47
47
expect ( toast . isVisible ) . toBe ( false ) ;
48
+ expect ( toast . isVisibleChange . emit ) . toHaveBeenCalledTimes ( 0 ) ;
49
+
48
50
toast . toggle ( ) ;
49
51
expect ( toast . isVisible ) . toBe ( true ) ;
52
+ flushMicrotasks ( ) ;
53
+ expect ( toast . isVisibleChange . emit ) . toHaveBeenCalledOnceWith ( { owner : toast , id : '0' } ) ;
54
+
50
55
toast . toggle ( ) ;
51
56
flushMicrotasks ( ) ;
52
57
expect ( toast . isVisible ) . toBe ( false ) ;
58
+ expect ( toast . isVisibleChange . emit ) . toHaveBeenCalledTimes ( 2 ) ;
53
59
} ) ) ;
54
60
} ) ;
55
61
You can’t perform that action at this time.
0 commit comments