Skip to content

Commit d1641bd

Browse files
authored
task-requestDetails test fix (#905)
* task-requestDetails test fix * removed fixed delays
1 parent 44df325 commit d1641bd

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

__tests__/task-requests/task-requestDetails.test.js

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ describe('Request container for non-super users', () => {
3636
}
3737
});
3838
await page.goto(
39-
'http://localhost:8000/task-requests/details/?id=dM5wwD9QsiTzi7eG7Oq5',
39+
'http://localhost:8000/task-requests/details/?id=dM5wwD9QsiTzi7eG7Oq5&dev=true',
4040
);
4141
});
4242

@@ -45,19 +45,15 @@ describe('Request container for non-super users', () => {
4545
});
4646

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

5755
it('Should render task status for non-super users', async function () {
58-
await page.goto(
59-
'http://localhost:8000/task-requests/details/?id=dM5wwD9QsiTzi7eG7Oq5&&dev=true',
60-
);
56+
await page.waitForNetworkIdle();
6157
const taskRequestStatus = await page.$(
6258
'[data-testid="requestors-task-status"]',
6359
);
@@ -152,8 +148,9 @@ describe('Task request details page', () => {
152148

153149
it('Should render Approve and Reject buttons for super users', async function () {
154150
await page.goto(
155-
'http://localhost:8000/task-requests/details/?id=dM5wwD9QsiTzi7eG7Oq5&&dev=true',
151+
'http://localhost:8000/task-requests/details/?id=dM5wwD9QsiTzi7eG7Oq5&dev=true',
156152
);
153+
await page.waitForNetworkIdle();
157154
const approveButton = await page.$('[data-testid="task-approve-button"]');
158155
const rejectButton = await page.$('[data-testid="task-reject-button"]');
159156
expect(approveButton).toBeTruthy();
@@ -246,8 +243,9 @@ describe('Task request details page with markdown support in description', () =>
246243

247244
it('Should render Approve and Reject buttons for super users', async function () {
248245
await page.goto(
249-
'http://localhost:8000/task-requests/details/?id=dM5wwD9QsiTzi7eG7Oq5&&dev=true',
246+
'http://localhost:8000/task-requests/details/?id=dM5wwD9QsiTzi7eG7Oq6&dev=true',
250247
);
248+
await page.waitForNetworkIdle();
251249
const approveButton = await page.$('[data-testid="task-approve-button"]');
252250
const rejectButton = await page.$('[data-testid="task-reject-button"]');
253251
expect(approveButton).toBeTruthy();

0 commit comments

Comments
 (0)