Skip to content

Commit

Permalink
removed fixed delays
Browse files Browse the repository at this point in the history
  • Loading branch information
AnujChhikara committed Nov 2, 2024
1 parent d2b7a0f commit 932ba8e
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions __tests__/task-requests/task-requestDetails.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ describe('Request container for non-super users', () => {
}
});
await page.goto(
'http://localhost:8000/task-requests/details/?id=dM5wwD9QsiTzi7eG7Oq5',
'http://localhost:8000/task-requests/details/?id=dM5wwD9QsiTzi7eG7Oq5&dev=true',
);
});

Expand All @@ -45,21 +45,15 @@ describe('Request container for non-super users', () => {
});

it('Approve and Reject buttons should not render for non-super users', async function () {
await page.goto(
'http://localhost:8000/task-requests/details/?id=dM5wwD9QsiTzi7eG7Oq5&dev=true',
);
await page.waitForTimeout(2000);
await page.waitForNetworkIdle();
const approveButton = await page.$('[data-testid="task-approve-button"]');
const rejectButton = await page.$('[data-testid="task-reject-button"]');
expect(approveButton).toBeNull();
expect(rejectButton).toBeNull();
});

it('Should render task status for non-super users', async function () {
await page.goto(
'http://localhost:8000/task-requests/details/?id=dM5wwD9QsiTzi7eG7Oq5&dev=true',
);
await page.waitForTimeout(2000);
await page.waitForNetworkIdle();
const taskRequestStatus = await page.$(
'[data-testid="requestors-task-status"]',
);
Expand Down Expand Up @@ -156,7 +150,7 @@ describe('Task request details page', () => {
await page.goto(
'http://localhost:8000/task-requests/details/?id=dM5wwD9QsiTzi7eG7Oq5&dev=true',
);
await page.waitForTimeout(2000);
await page.waitForNetworkIdle();
const approveButton = await page.$('[data-testid="task-approve-button"]');
const rejectButton = await page.$('[data-testid="task-reject-button"]');
expect(approveButton).toBeTruthy();
Expand Down Expand Up @@ -251,7 +245,7 @@ describe('Task request details page with markdown support in description', () =>
await page.goto(
'http://localhost:8000/task-requests/details/?id=dM5wwD9QsiTzi7eG7Oq6&dev=true',
);
await page.waitForTimeout(2000);
await page.waitForNetworkIdle();
const approveButton = await page.$('[data-testid="task-approve-button"]');
const rejectButton = await page.$('[data-testid="task-reject-button"]');
expect(approveButton).toBeTruthy();
Expand Down

0 comments on commit 932ba8e

Please sign in to comment.