Guest User

Untitled

a guest
Dec 19th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. it('should show quote after getQuote (async)', async(() => {
  2. fixture.detectChanges(); // ngOnInit()
  3. expect(quoteEl.textContent).toBe('...', 'should show placeholder');
  4.  
  5. fixture.whenStable().then(() => { // wait for async getQuote
  6. fixture.detectChanges(); // update view with quote
  7. expect(quoteEl.textContent).toBe(testQuote);
  8. expect(errorMessage()).toBeNull('should not show error');
  9. });
  10. }));
Add Comment
Please, Sign In to add comment