Skip to content

Commit

Permalink
added setTimeout to extension-requests.test.js
Browse files Browse the repository at this point in the history
  • Loading branch information
rishirishhh committed Oct 13, 2024
1 parent 8234191 commit 20000fe
Show file tree
Hide file tree
Showing 2 changed files with 609 additions and 748 deletions.
11 changes: 6 additions & 5 deletions __tests__/extension-requests/extension-requests.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const {
extensionRequestLogs,
extensionRequestLogsInSentence,
} = require('../../mock-data/logs');
const setTimeout = require('node:timers/promises').setTimeout;
const {
userSunny,
userRandhir,
Expand Down Expand Up @@ -633,7 +634,7 @@ describe('Tests the Extension Requests Screen', () => {
break;
}
}
await page.waitForTimeout(1650);
await setTimeout(1650);

const extensionCardsAfter = await page.$$('.extension-card');

Expand All @@ -656,7 +657,7 @@ describe('Tests the Extension Requests Screen', () => {
break;
}
}
await page.waitForTimeout(850);
await setTimeout(850);

const extensionCardsAfter = await page.$$('.extension-card');

Expand Down Expand Up @@ -720,7 +721,7 @@ describe('Tests the Extension Requests Screen', () => {

await page.click('.update-button');

await page.waitForTimeout(1100);
await setTimeout(1100);

await page.waitForNetworkIdle();

Expand Down Expand Up @@ -900,7 +901,7 @@ describe('Tests the Extension Requests Screen', () => {
);

await page.$$eval('.update-button', (buttons) => buttons[0].click());
await page.waitForTimeout(1100);
await setTimeout(1100);
await page.waitForNetworkIdle();
logs = await extensionLogsForFirstER.$$('.log-div');
expect(Array.from(logs).length).toBe(9);
Expand Down Expand Up @@ -966,7 +967,7 @@ describe('Tests the Extension Requests Screen', () => {
for (const card of extensionCardsList) {
let approveButton = await card.$('.approve-button');
await approveButton.click();
await page.waitForTimeout(1700);
await setTimeout(1700);
}

extensionRequestsElement = await page.$('.extension-requests');
Expand Down
Loading

0 comments on commit 20000fe

Please sign in to comment.