Skip to content

Commit

Permalink
test(module:auto-complete): add the feat test
Browse files Browse the repository at this point in the history
  • Loading branch information
hsuanxyz committed Feb 18, 2019
1 parent 176d0bd commit 53593e6
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions components/auto-complete/nz-autocomplete.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,20 @@ describe('auto-complete', () => {
.toBe(false);
}));

it('should close the panel when the trigger blur', fakeAsync(() => {
dispatchFakeEvent(input, 'focusin');
fixture.detectChanges();
flush();

expect(fixture.componentInstance.trigger.panelOpen)
.toBe(true);

dispatchFakeEvent(input, 'blur');

expect(fixture.componentInstance.trigger.panelOpen)
.toBe(false);
}));

it('should not close the panel when the user clicks this input', fakeAsync(() => {
dispatchFakeEvent(input, 'focusin');
fixture.detectChanges();
Expand Down

0 comments on commit 53593e6

Please sign in to comment.