File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
projects/testing-library/tests/issues Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 11import { AsyncPipe } from '@angular/common' ;
22import { Component , inject , Injectable } from '@angular/core' ;
3- import { render , screen , waitFor } from '../../src/public_api' ;
3+ import { render , screen } from '../../src/public_api' ;
44import { Observable , BehaviorSubject , map } from 'rxjs' ;
55
66test ( 'displays username' , async ( ) => {
@@ -21,13 +21,13 @@ test('displays username', async () => {
2121 } ) ;
2222
2323 // assert first username emitted is rendered
24- expect ( await screen . findByRole ( 'heading' ) ) . toHaveTextContent ( 'username 1' ) ;
24+ expect ( await screen . findByRole ( 'heading' , { name : 'username 1' } ) ) . toBeInTheDocument ( ) ;
2525
2626 // emitting a second username
2727 user . next ( { name : 'username 2' } ) ;
2828
2929 // assert the second username is rendered
30- await waitFor ( ( ) => expect ( screen . getByRole ( 'heading' ) ) . toHaveTextContent ( 'username 2' ) ) ;
30+ expect ( await screen . findByRole ( 'heading' , { name : 'username 2' } ) ) . toBeInTheDocument ( ) ;
3131} ) ;
3232
3333@Component ( {
You can’t perform that action at this time.
0 commit comments