Skip to content

Commit aa5c07c

Browse files
committed
update test
1 parent 041d720 commit aa5c07c

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

e2e/test-utils/stackable.ts

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,9 @@ export class StackableFixture {
88
this.page = page
99
}
1010

11-
// When loading the Stackable settings in the Admin, there are 4 requests to wp/v2/settings
12-
// This function waits for all 4 requests to finish to ensure Stackable settings are loaded and reflected on the page
11+
// Wait for Stackable Settings to be fetched
1312
async waitForSettings(): Promise<void> {
1413
return new Promise( ( resolve, reject ) => {
15-
let responseCount = 0
16-
1714
const cleanup = () => {
1815
this.page.off( 'requestfinished', finishedCallback )
1916
this.page.off( 'requestfinished', failedCallback )
@@ -29,14 +26,10 @@ export class StackableFixture {
2926
} )
3027

3128
if ( settings ) {
32-
responseCount++
33-
} else {
34-
throw Error( 'Failed to get Stackable settings' )
35-
}
36-
37-
if ( responseCount === 4 ) {
3829
cleanup()
3930
resolve()
31+
} else {
32+
throw Error( 'Failed to get Stackable settings' )
4033
}
4134
} catch ( error ) {
4235
cleanup()

0 commit comments

Comments
 (0)