Skip to content

Commit 5a7718c

Browse files
authored
test: migrate allowedHosts and api tests (#4196)
1 parent 2a537d2 commit 5a7718c

File tree

2 files changed

+43
-58
lines changed

2 files changed

+43
-58
lines changed

test/e2e/allowed-hosts.test.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ describe("allowed hosts", () => {
7373
pageErrors.push(error);
7474
});
7575

76-
await page.goto(`http://${proxyHost}:${proxyPort}/main`, {
76+
await page.goto(`http://${proxyHost}:${proxyPort}/`, {
7777
waitUntil: "networkidle0",
7878
});
7979

@@ -152,7 +152,7 @@ describe("allowed hosts", () => {
152152
pageErrors.push(error);
153153
});
154154

155-
await page.goto(`http://${proxyHost}:${proxyPort}/main`, {
155+
await page.goto(`http://${proxyHost}:${proxyPort}/`, {
156156
waitUntil: "networkidle0",
157157
});
158158

@@ -228,7 +228,7 @@ describe("allowed hosts", () => {
228228
pageErrors.push(error);
229229
});
230230

231-
await page.goto(`http://${proxyHost}:${proxyPort}/main`, {
231+
await page.goto(`http://${proxyHost}:${proxyPort}/`, {
232232
waitUntil: "networkidle0",
233233
});
234234

@@ -300,7 +300,7 @@ describe("allowed hosts", () => {
300300
pageErrors.push(error);
301301
});
302302

303-
await page.goto(`http://${proxyHost}:${proxyPort}/main`, {
303+
await page.goto(`http://${proxyHost}:${proxyPort}/`, {
304304
waitUntil: "networkidle0",
305305
});
306306

@@ -372,7 +372,7 @@ describe("allowed hosts", () => {
372372
pageErrors.push(error);
373373
});
374374

375-
await page.goto(`http://${proxyHost}:${proxyPort}/main`, {
375+
await page.goto(`http://${proxyHost}:${proxyPort}/`, {
376376
waitUntil: "networkidle0",
377377
});
378378

@@ -444,7 +444,7 @@ describe("allowed hosts", () => {
444444
pageErrors.push(error);
445445
});
446446

447-
await page.goto(`http://[${proxyHost}]:${proxyPort}/main`, {
447+
await page.goto(`http://[${proxyHost}]:${proxyPort}/`, {
448448
waitUntil: "networkidle0",
449449
});
450450

@@ -519,7 +519,7 @@ describe("allowed hosts", () => {
519519
pageErrors.push(error);
520520
});
521521

522-
await page.goto(`http://${proxyHost}:${proxyPort}/main`, {
522+
await page.goto(`http://${proxyHost}:${proxyPort}/`, {
523523
waitUntil: "networkidle0",
524524
});
525525

@@ -594,7 +594,7 @@ describe("allowed hosts", () => {
594594
pageErrors.push(error);
595595
});
596596

597-
await page.goto(`http://${proxyHost}:${proxyPort}/main`, {
597+
await page.goto(`http://${proxyHost}:${proxyPort}/`, {
598598
waitUntil: "networkidle0",
599599
});
600600

@@ -670,7 +670,7 @@ describe("allowed hosts", () => {
670670
pageErrors.push(error);
671671
});
672672

673-
await page.goto(`http://${proxyHost}:${proxyPort}/main`, {
673+
await page.goto(`http://${proxyHost}:${proxyPort}/`, {
674674
waitUntil: "networkidle0",
675675
});
676676

@@ -746,7 +746,7 @@ describe("allowed hosts", () => {
746746
pageErrors.push(error);
747747
});
748748

749-
await page.goto(`http://${proxyHost}:${proxyPort}/main`, {
749+
await page.goto(`http://${proxyHost}:${proxyPort}/`, {
750750
waitUntil: "networkidle0",
751751
});
752752

@@ -822,7 +822,7 @@ describe("allowed hosts", () => {
822822
pageErrors.push(error);
823823
});
824824

825-
await page.goto(`http://${proxyHost}:${proxyPort}/main`, {
825+
await page.goto(`http://${proxyHost}:${proxyPort}/`, {
826826
waitUntil: "networkidle0",
827827
});
828828

@@ -898,7 +898,7 @@ describe("allowed hosts", () => {
898898
pageErrors.push(error);
899899
});
900900

901-
await page.goto(`http://${proxyHost}:${proxyPort}/main`, {
901+
await page.goto(`http://${proxyHost}:${proxyPort}/`, {
902902
waitUntil: "networkidle0",
903903
});
904904

@@ -977,7 +977,7 @@ describe("allowed hosts", () => {
977977
pageErrors.push(error);
978978
});
979979

980-
await page.goto(`http://${proxyHost}:${proxyPort}/main`, {
980+
await page.goto(`http://${proxyHost}:${proxyPort}/`, {
981981
waitUntil: "networkidle0",
982982
});
983983

@@ -1053,7 +1053,7 @@ describe("allowed hosts", () => {
10531053
pageErrors.push(error);
10541054
});
10551055

1056-
await page.goto(`http://${proxyHost}:${proxyPort}/main`, {
1056+
await page.goto(`http://${proxyHost}:${proxyPort}/`, {
10571057
waitUntil: "networkidle0",
10581058
});
10591059

@@ -1130,7 +1130,7 @@ describe("allowed hosts", () => {
11301130
pageErrors.push(error);
11311131
});
11321132

1133-
await page.goto(`http://${proxyHost}:${proxyPort}/main`, {
1133+
await page.goto(`http://${proxyHost}:${proxyPort}/`, {
11341134
waitUntil: "networkidle0",
11351135
});
11361136

test/e2e/api.test.js

Lines changed: 28 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ describe("API", () => {
5757

5858
expect(process.env.WEBPACK_SERVE).toBe(true);
5959

60-
const response = await page.goto(`http://127.0.0.1:${port}/main`, {
60+
const response = await page.goto(`http://127.0.0.1:${port}/`, {
6161
waitUntil: "networkidle0",
6262
});
6363

@@ -91,7 +91,7 @@ describe("API", () => {
9191
pageErrors.push(error);
9292
});
9393

94-
await page.goto(`http://127.0.0.1:${port}/main`, {
94+
await page.goto(`http://127.0.0.1:${port}/`, {
9595
waitUntil: "networkidle0",
9696
});
9797

@@ -127,7 +127,7 @@ describe("API", () => {
127127
pageErrors.push(error);
128128
});
129129

130-
await page.goto(`http://127.0.0.1:${port}/main`, {
130+
await page.goto(`http://127.0.0.1:${port}/`, {
131131
waitUntil: "networkidle0",
132132
});
133133

@@ -197,7 +197,7 @@ describe("API", () => {
197197
pageErrors.push(error);
198198
});
199199

200-
await page.goto(`http://127.0.0.1:${port}/main`, {
200+
await page.goto(`http://127.0.0.1:${port}/`, {
201201
waitUntil: "networkidle0",
202202
});
203203

@@ -229,7 +229,7 @@ describe("API", () => {
229229
firstPageErrors.push(error);
230230
});
231231

232-
await firstPage.goto(`http://127.0.0.1:${port}/main`, {
232+
await firstPage.goto(`http://127.0.0.1:${port}/`, {
233233
waitUntil: "networkidle0",
234234
});
235235

@@ -254,7 +254,7 @@ describe("API", () => {
254254
secondPageErrors.push(error);
255255
});
256256

257-
await secondPage.goto(`http://127.0.0.1:${port}/main`, {
257+
await secondPage.goto(`http://127.0.0.1:${port}/`, {
258258
waitUntil: "networkidle0",
259259
});
260260

@@ -300,7 +300,7 @@ describe("API", () => {
300300
pageErrors.push(error);
301301
});
302302

303-
await page.goto(`http://127.0.0.1:${port}/main`, {
303+
await page.goto(`http://127.0.0.1:${port}/`, {
304304
waitUntil: "networkidle0",
305305
});
306306

@@ -366,7 +366,7 @@ describe("API", () => {
366366
pageErrors.push(error);
367367
});
368368

369-
await page.goto(`http://127.0.0.1:${port}/main`, {
369+
await page.goto(`http://127.0.0.1:${port}/`, {
370370
waitUntil: "networkidle0",
371371
});
372372

@@ -416,7 +416,7 @@ describe("API", () => {
416416
pageErrors.push(error);
417417
});
418418

419-
await page.goto(`http://127.0.0.1:${port}/main`, {
419+
await page.goto(`http://127.0.0.1:${port}/`, {
420420
waitUntil: "networkidle0",
421421
});
422422

@@ -454,7 +454,7 @@ describe("API", () => {
454454
pageErrors.push(error);
455455
});
456456

457-
await page.goto(`http://127.0.0.1:${port}/main`, {
457+
await page.goto(`http://127.0.0.1:${port}/`, {
458458
waitUntil: "networkidle0",
459459
});
460460

@@ -509,7 +509,7 @@ describe("API", () => {
509509

510510
expect(server.middleware.context.callbacks.length).toEqual(1);
511511

512-
const response = await page.goto(`http://127.0.0.1:${port}/main`, {
512+
const response = await page.goto(`http://127.0.0.1:${port}/`, {
513513
waitUntil: "networkidle0",
514514
});
515515

@@ -528,7 +528,7 @@ describe("API", () => {
528528

529529
expect(server.middleware.context.callbacks[0]).toBe(callback);
530530

531-
const response = await page.goto(`http://127.0.0.1:${port}/main`, {
531+
const response = await page.goto(`http://127.0.0.1:${port}/`, {
532532
waitUntil: "networkidle0",
533533
});
534534

@@ -628,12 +628,9 @@ describe("API", () => {
628628
pageErrors.push(error);
629629
});
630630

631-
const response = await page.goto(
632-
`http://127.0.0.1:${devServerPort}/main`,
633-
{
634-
waitUntil: "networkidle0",
635-
}
636-
);
631+
const response = await page.goto(`http://127.0.0.1:${devServerPort}/`, {
632+
waitUntil: "networkidle0",
633+
});
637634

638635
expect(response.status()).toMatchSnapshot("response status");
639636

@@ -671,12 +668,9 @@ describe("API", () => {
671668
pageErrors.push(error);
672669
});
673670

674-
const response = await page.goto(
675-
`http://127.0.0.1:${devServerPort}/main`,
676-
{
677-
waitUntil: "networkidle0",
678-
}
679-
);
671+
const response = await page.goto(`http://127.0.0.1:${devServerPort}/`, {
672+
waitUntil: "networkidle0",
673+
});
680674

681675
expect(response.status()).toMatchSnapshot("response status");
682676

@@ -713,12 +707,9 @@ describe("API", () => {
713707
pageErrors.push(error);
714708
});
715709

716-
const response = await page.goto(
717-
`http://127.0.0.1:${devServerPort}/main`,
718-
{
719-
waitUntil: "networkidle0",
720-
}
721-
);
710+
const response = await page.goto(`http://127.0.0.1:${devServerPort}/`, {
711+
waitUntil: "networkidle0",
712+
});
722713

723714
expect(response.status()).toMatchSnapshot("response status");
724715

@@ -755,12 +746,9 @@ describe("API", () => {
755746
pageErrors.push(error);
756747
});
757748

758-
const response = await page.goto(
759-
`http://127.0.0.1:${devServerPort}/main`,
760-
{
761-
waitUntil: "networkidle0",
762-
}
763-
);
749+
const response = await page.goto(`http://127.0.0.1:${devServerPort}/`, {
750+
waitUntil: "networkidle0",
751+
});
764752

765753
expect(response.status()).toMatchSnapshot("response status");
766754

@@ -797,12 +785,9 @@ describe("API", () => {
797785
pageErrors.push(error);
798786
});
799787

800-
const response = await page.goto(
801-
`http://127.0.0.1:${devServerPort}/main`,
802-
{
803-
waitUntil: "networkidle0",
804-
}
805-
);
788+
const response = await page.goto(`http://127.0.0.1:${devServerPort}/`, {
789+
waitUntil: "networkidle0",
790+
});
806791

807792
expect(response.status()).toMatchSnapshot("response status");
808793

@@ -898,7 +883,7 @@ describe("API", () => {
898883
webSocketRequests.push(test);
899884
});
900885

901-
const response = await page.goto(`http://127.0.0.1:${port}/main`, {
886+
const response = await page.goto(`http://127.0.0.1:${port}/`, {
902887
waitUntil: "networkidle0",
903888
});
904889

0 commit comments

Comments
 (0)