Last active
June 27, 2018 04:01
-
-
Save cartant/873d89b5b43c7d549e4d5cd384742a37 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| it('should indicate when searching', fakeSchedulers(() => { | |
| const fixture = TestBed.createComponent(SomeComponent); | |
| fixture.detectChanges(); | |
| const compiled = fixture.debugElement.nativeElement; | |
| const input = compiled.querySelector('input'); | |
| expect(compiled.querySelector('.searching')).toBeNull(); | |
| fixture.componentInstance.form.patchValue({ term: 'foo' }); | |
| fixture.detectChanges(); | |
| expect(compiled.querySelector('.searching')).toBeNull(); | |
| tick(400); | |
| fixture.detectChanges(); | |
| expect(compiled.querySelector('.searching')).not.toBeNull(); | |
| expect(compiled.querySelector('.searching span').textContent).toMatch(/foo/); | |
| })); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment