Skip to content

Commit 4409cfc

Browse files
committed
test(IgxToggle): test that show method display correctly a message #7156
1 parent 901204b commit 4409cfc

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

projects/igniteui-angular/src/lib/toast/toast.component.spec.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,22 @@ describe('IgxToast', () => {
132132
expect(toast.onShown.emit).toHaveBeenCalledTimes(1);
133133
expect(toast.onHiding.emit).toHaveBeenCalledTimes(1);
134134
expect(toast.onHidden.emit).toHaveBeenCalledTimes(1);
135-
136135
});
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+
}));
137151
});
138152

139153
@Component({

0 commit comments

Comments
 (0)