File tree Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Original file line number Diff line number Diff line change 21
21
"preset" : " jest-puppeteer" ,
22
22
"coveragePathIgnorePatterns" : [
23
23
" dist/" ,
24
- " elementParser.ts"
24
+ " elementParser.ts" ,
25
+ " pageInteractor.ts"
25
26
],
26
27
"testPathIgnorePatterns" : [
27
28
" dist/"
Original file line number Diff line number Diff line change @@ -516,9 +516,12 @@ describe("Login", () => {
516
516
const module = ModuleFactory . create ( page ) ;
517
517
const pageInteractor = module . pageInteractor ;
518
518
519
+ module . urlChanger . loginURL = "https://example.com" ;
519
520
await module . urlChanger . moveToLoginURL ( ) ;
520
521
await page . setContent ( loginHTML ) ;
521
522
523
+ await page . waitForSelector ( "#log\\.login" ) ;
524
+
522
525
await page . evaluate ( ( loginURL : string ) => {
523
526
// make login button to do nothing
524
527
const loginButton = document . querySelector ( "#log\\.login" ) ;
@@ -538,12 +541,7 @@ describe("Login", () => {
538
541
await page . setContent ( manualOTPHTML ) ;
539
542
540
543
// when
541
- const loginStatus$ = interval ( 500 ) . pipe (
542
- mergeMap ( ( ) => pageInteractor . getLoginStatus ( ) )
543
- ) ;
544
- const firstEvent = await firstValueFrom ( loginStatus$ ) ;
545
-
546
- // then
547
- expect ( firstEvent ) . toEqual ( "manual-otp-required" ) ;
544
+ const status = await pageInteractor . getLoginStatus ( ) ;
545
+ expect ( status ) . toBe ( "manual-otp-required" ) ;
548
546
} ) ;
549
547
} ) ;
You can’t perform that action at this time.
0 commit comments