Skip to content

Commit

Permalink
add promise
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouyx committed Apr 10, 2020
1 parent c48fe93 commit 5067a21
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ describes.endtoend(
it('should work with client side decision', async () => {
resetAllElements();
const currentUrl = await controller.getCurrentUrl();
//console.log('currentUrl is ', currentUrl);

// Verify no local storage decision
await findElements(controller);
Expand Down Expand Up @@ -96,11 +95,11 @@ describes.endtoend(
'postPromptUi': false,
});

// Check the analytics request consentState
// const p = new Promise((resolve) => {
// setTimeout(resolve, 1000);
// });
// await p;
// Check the analytics request consentState. Wait for 1 second for the
// request to arrive to avoid flaky test.
await new Promise((resolve) => {
setTimeout(resolve, 1000);
});
await expect(
'http://localhost:8000/amp4test/request-bank/e2e/deposit/tracking?consentState=sufficient'
).to.have.been.sent;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ describes.endtoend(
controller = env.controller;
});

//TODO (micajuineho): Unskip flaky test
it('should respect server side decision and persist it', async () => {
resetAllElements();

Expand Down Expand Up @@ -79,7 +78,11 @@ describes.endtoend(
'postPromptUi': false,
});

// Check the analytics request consentState
// Check the analytics request consentState. Wait for 1 second for the
// request to arrive to avoid flaky test.
await new Promise((resolve) => {
setTimeout(resolve, 1000);
});
await expect(
'http://localhost:8000/amp4test/request-bank/e2e/deposit/tracking?consentState=insufficient'
).to.have.been.sent;
Expand Down

0 comments on commit 5067a21

Please sign in to comment.