Skip to content

Commit 3c1a807

Browse files
committed
Revert "Revert "Add .only to document request tests""
This reverts commit 21f28d1.
1 parent 77e6254 commit 3c1a807

13 files changed

+48
-48
lines changed

integration/action-test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,13 @@ test.describe("actions", () => {
8787
expect(logs).toHaveLength(0);
8888
});
8989

90-
test("is not called on document GET requests", async () => {
90+
test.only("is not called on document GET requests", async () => {
9191
let res = await fixture.requestDocument("/urlencoded");
9292
let html = selectHtml(await res.text(), "#text");
9393
expect(html).toMatch(WAITING_VALUE);
9494
});
9595

96-
test("is called on document POST requests", async () => {
96+
test.only("is called on document POST requests", async () => {
9797
let FIELD_VALUE = "cheeseburger";
9898

9999
let params = new URLSearchParams();
@@ -115,7 +115,7 @@ test.describe("actions", () => {
115115
await page.waitForSelector(`#text:has-text("${SUBMITTED_VALUE}")`);
116116
});
117117

118-
test("redirects a thrown response on document requests", async () => {
118+
test.only("redirects a thrown response on document requests", async () => {
119119
let params = new URLSearchParams();
120120
let res = await fixture.postDocument(`/${THROWS_REDIRECT}`, params);
121121
expect(res.status).toBe(302);

integration/catch-boundary-data-test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ test.beforeAll(async () => {
158158

159159
test.afterAll(async () => appFixture.close());
160160

161-
test("renders root boundary with data available", async () => {
161+
test.only("renders root boundary with data available", async () => {
162162
let res = await fixture.requestDocument(NO_BOUNDARY_LOADER);
163163
expect(res.status).toBe(401);
164164
let html = await res.text();
@@ -176,7 +176,7 @@ test("renders root boundary with data available on transition", async ({
176176
await page.waitForSelector(`#root-boundary-data:has-text("${ROOT_DATA}")`);
177177
});
178178

179-
test("renders layout boundary with data available", async () => {
179+
test.only("renders layout boundary with data available", async () => {
180180
let res = await fixture.requestDocument(HAS_BOUNDARY_LAYOUT_NESTED_LOADER);
181181
expect(res.status).toBe(401);
182182
let html = await res.text();
@@ -200,7 +200,7 @@ test("renders layout boundary with data available on transition", async ({
200200
);
201201
});
202202

203-
test("renders self boundary with layout data available", async () => {
203+
test.only("renders self boundary with layout data available", async () => {
204204
let res = await fixture.requestDocument(HAS_BOUNDARY_NESTED_LOADER);
205205
expect(res.status).toBe(401);
206206
let html = await res.text();

integration/catch-boundary-test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ test.describe("CatchBoundary", () => {
185185

186186
test.afterAll(() => appFixture.close());
187187

188-
test("non-matching urls on document requests", async () => {
188+
test.only("non-matching urls on document requests", async () => {
189189
let res = await fixture.requestDocument(NOT_FOUND_HREF);
190190
expect(res.status).toBe(404);
191191
expect(await res.text()).toMatch(ROOT_BOUNDARY_TEXT);
@@ -198,7 +198,7 @@ test.describe("CatchBoundary", () => {
198198
await page.waitForSelector("#root-boundary");
199199
});
200200

201-
test("own boundary, action, document request", async () => {
201+
test.only("own boundary, action, document request", async () => {
202202
let params = new URLSearchParams();
203203
let res = await fixture.postDocument(HAS_BOUNDARY_ACTION, params);
204204
expect(res.status).toBe(401);
@@ -223,7 +223,7 @@ test.describe("CatchBoundary", () => {
223223
await page.waitForSelector("#action-boundary");
224224
});
225225

226-
test("bubbles to parent in action document requests", async () => {
226+
test.only("bubbles to parent in action document requests", async () => {
227227
let params = new URLSearchParams();
228228
let res = await fixture.postDocument(NO_BOUNDARY_ACTION, params);
229229
expect(res.status).toBe(401);
@@ -248,7 +248,7 @@ test.describe("CatchBoundary", () => {
248248
await page.waitForSelector("#root-boundary");
249249
});
250250

251-
test("own boundary, loader, document request", async () => {
251+
test.only("own boundary, loader, document request", async () => {
252252
let res = await fixture.requestDocument(HAS_BOUNDARY_LOADER);
253253
expect(res.status).toBe(401);
254254
expect(await res.text()).toMatch(OWN_BOUNDARY_TEXT);
@@ -261,7 +261,7 @@ test.describe("CatchBoundary", () => {
261261
await page.waitForSelector("#boundary-loader");
262262
});
263263

264-
test("bubbles to parent in loader document requests", async () => {
264+
test.only("bubbles to parent in loader document requests", async () => {
265265
let res = await fixture.requestDocument(NO_BOUNDARY_LOADER);
266266
expect(res.status).toBe(401);
267267
expect(await res.text()).toMatch(ROOT_BOUNDARY_TEXT);

integration/error-boundary-test.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -286,13 +286,13 @@ test.describe("ErrorBoundary", () => {
286286
await appFixture.close();
287287
});
288288

289-
test("invalid request methods", async () => {
289+
test.only("invalid request methods", async () => {
290290
let res = await fixture.requestDocument("/", { method: "OPTIONS" });
291291
expect(res.status).toBe(405);
292292
expect(await res.text()).toMatch(ROOT_BOUNDARY_TEXT);
293293
});
294294

295-
test("own boundary, action, document request", async () => {
295+
test.only("own boundary, action, document request", async () => {
296296
let params = new URLSearchParams();
297297
let res = await fixture.postDocument(HAS_BOUNDARY_ACTION, params);
298298
expect(res.status).toBe(500);
@@ -319,7 +319,7 @@ test.describe("ErrorBoundary", () => {
319319
expect(await app.getHtml("main")).toMatch(OWN_BOUNDARY_TEXT);
320320
});
321321

322-
test("bubbles to parent in action document requests", async () => {
322+
test.only("bubbles to parent in action document requests", async () => {
323323
let params = new URLSearchParams();
324324
let res = await fixture.postDocument(NO_BOUNDARY_ACTION, params);
325325
expect(res.status).toBe(500);
@@ -344,7 +344,7 @@ test.describe("ErrorBoundary", () => {
344344
expect(await app.getHtml("main")).toMatch(ROOT_BOUNDARY_TEXT);
345345
});
346346

347-
test("own boundary, loader, document request", async () => {
347+
test.only("own boundary, loader, document request", async () => {
348348
let res = await fixture.requestDocument(HAS_BOUNDARY_LOADER);
349349
expect(res.status).toBe(500);
350350
expect(await res.text()).toMatch(OWN_BOUNDARY_TEXT);
@@ -357,7 +357,7 @@ test.describe("ErrorBoundary", () => {
357357
expect(await app.getHtml("main")).toMatch(OWN_BOUNDARY_TEXT);
358358
});
359359

360-
test("bubbles to parent in loader document requests", async () => {
360+
test.only("bubbles to parent in loader document requests", async () => {
361361
let res = await fixture.requestDocument(NO_BOUNDARY_LOADER);
362362
expect(res.status).toBe(500);
363363
expect(await res.text()).toMatch(ROOT_BOUNDARY_TEXT);
@@ -372,7 +372,7 @@ test.describe("ErrorBoundary", () => {
372372
expect(await app.getHtml("main")).toMatch(ROOT_BOUNDARY_TEXT);
373373
});
374374

375-
test("ssr rendering errors with no boundary", async () => {
375+
test.only("ssr rendering errors with no boundary", async () => {
376376
let res = await fixture.requestDocument(NO_BOUNDARY_RENDER);
377377
expect(res.status).toBe(500);
378378
expect(await res.text()).toMatch(ROOT_BOUNDARY_TEXT);
@@ -387,7 +387,7 @@ test.describe("ErrorBoundary", () => {
387387
expect(await app.getHtml("main")).toMatch(ROOT_BOUNDARY_TEXT);
388388
});
389389

390-
test("ssr rendering errors with boundary", async () => {
390+
test.only("ssr rendering errors with boundary", async () => {
391391
let res = await fixture.requestDocument(HAS_BOUNDARY_RENDER);
392392
expect(res.status).toBe(500);
393393
expect(await res.text()).toMatch(OWN_BOUNDARY_TEXT);
@@ -432,7 +432,7 @@ test.describe("ErrorBoundary", () => {
432432
await page.waitForSelector("#root-boundary");
433433
});
434434

435-
test("renders root boundary in document POST without action requests", async () => {
435+
test.only("renders root boundary in document POST without action requests", async () => {
436436
let res = await fixture.requestDocument(NO_BOUNDARY_NO_LOADER_OR_ACTION, {
437437
method: "post",
438438
});
@@ -449,7 +449,7 @@ test.describe("ErrorBoundary", () => {
449449
await page.waitForSelector("#root-boundary");
450450
});
451451

452-
test("renders own boundary in document POST without action requests", async () => {
452+
test.only("renders own boundary in document POST without action requests", async () => {
453453
let res = await fixture.requestDocument(HAS_BOUNDARY_NO_LOADER_OR_ACTION, {
454454
method: "post",
455455
});
@@ -595,7 +595,7 @@ test.describe("ErrorBoundary", () => {
595595
expect(await app.getHtml("h1")).toMatch(INTERNAL_ERROR_BOUNDARY_HEADING);
596596
});
597597

598-
test("bubbles to internal boundary if loader doesn't return (document requests)", async () => {
598+
test.only("bubbles to internal boundary if loader doesn't return (document requests)", async () => {
599599
let res = await fixture.requestDocument(NO_ROOT_BOUNDARY_LOADER_RETURN);
600600
expect(res.status).toBe(500);
601601
expect(await res.text()).toMatch(INTERNAL_ERROR_BOUNDARY_HEADING);
@@ -611,7 +611,7 @@ test.describe("ErrorBoundary", () => {
611611
expect(await app.getHtml("h1")).toMatch(INTERNAL_ERROR_BOUNDARY_HEADING);
612612
});
613613

614-
test("bubbles to internal boundary if action doesn't return (document requests)", async () => {
614+
test.only("bubbles to internal boundary if action doesn't return (document requests)", async () => {
615615
let res = await fixture.requestDocument(NO_ROOT_BOUNDARY_ACTION_RETURN, {
616616
method: "post",
617617
});

integration/form-data-test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ test.beforeAll(async () => {
2424
});
2525
});
2626

27-
test("invalid content-type does not crash server", async () => {
27+
test.only("invalid content-type does not crash server", async () => {
2828
let response = await fixture.requestDocument("/", {
2929
method: "post",
3030
headers: { "content-type": "application/json" },
3131
});
3232
expect(await response.text()).toMatch("no pizza");
3333
});
3434

35-
test("invalid urlencoded body does not crash server", async () => {
35+
test.only("invalid urlencoded body does not crash server", async () => {
3636
let response = await fixture.requestDocument("/", {
3737
method: "post",
3838
headers: { "content-type": "application/x-www-form-urlencoded" },
@@ -41,7 +41,7 @@ test("invalid urlencoded body does not crash server", async () => {
4141
expect(await response.text()).toMatch("pizza");
4242
});
4343

44-
test("invalid multipart content-type does not crash server", async () => {
44+
test.only("invalid multipart content-type does not crash server", async () => {
4545
let response = await fixture.requestDocument("/", {
4646
method: "post",
4747
headers: { "content-type": "multipart/form-data" },
@@ -50,7 +50,7 @@ test("invalid multipart content-type does not crash server", async () => {
5050
expect(await response.text()).toMatch("pizza");
5151
});
5252

53-
test("invalid multipart body does not crash server", async () => {
53+
test.only("invalid multipart body does not crash server", async () => {
5454
let response = await fixture.requestDocument("/", {
5555
method: "post",
5656
headers: { "content-type": "multipart/form-data; boundary=abc" },

integration/form-test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ test.describe("Forms", () => {
458458
await appFixture.close();
459459
});
460460

461-
test.describe("without JavaScript", () => {
461+
test.describe.only("without JavaScript", () => {
462462
test.use({ javaScriptEnabled: false });
463463

464464
runFormTests();

integration/headers-test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,20 +81,20 @@ test.describe("headers export", () => {
8181
});
8282
});
8383

84-
test("can use `action` headers", async () => {
84+
test.only("can use `action` headers", async () => {
8585
let response = await appFixture.postDocument(
8686
"/action",
8787
new URLSearchParams()
8888
);
8989
expect(response.headers.get(ACTION_HKEY)).toBe(ACTION_HVALUE);
9090
});
9191

92-
test("can use the loader headers when all routes have loaders", async () => {
92+
test.only("can use the loader headers when all routes have loaders", async () => {
9393
let response = await appFixture.requestDocument("/");
9494
expect(response.headers.get(ROOT_HEADER_KEY)).toBe(ROOT_HEADER_VALUE);
9595
});
9696

97-
test("can use the loader headers when parents don't have loaders", async () => {
97+
test.only("can use the loader headers when parents don't have loaders", async () => {
9898
let HEADER_KEY = "X-Test";
9999
let HEADER_VALUE = "SUCCESS";
100100

integration/path-mapping-test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,18 +100,18 @@ test.beforeAll(async () => {
100100
});
101101
});
102102

103-
test("import internal library via alias other than ~", async () => {
103+
test.only("import internal library via alias other than ~", async () => {
104104
// test for https://github.com/remix-run/remix/issues/2298
105105
let response = await fixture.requestDocument("/");
106106
expect(await response.text()).toMatch("this is a pizza");
107107
});
108108

109-
test("import internal library via ~ alias", async () => {
109+
test.only("import internal library via ~ alias", async () => {
110110
let response = await fixture.requestDocument("/tilde-alias");
111111
expect(await response.text()).toMatch("this is a pizza");
112112
});
113113

114-
test("works for mdx files", async () => {
114+
test.only("works for mdx files", async () => {
115115
let response = await fixture.requestDocument("/mdx");
116116
expect(await response.text()).toMatch("this is a pizza");
117117
});

integration/prefetch-test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ test.describe("prefetch=none", () => {
8585

8686
test.afterAll(() => appFixture.close());
8787

88-
test("does not render prefetch tags during SSR", async ({ page }) => {
88+
test.only("does not render prefetch tags during SSR", async ({ page }) => {
8989
let res = await fixture.requestDocument("/");
9090
expect(res.status).toBe(200);
9191
expect(await page.locator("#nav link").count()).toBe(0);
@@ -111,7 +111,7 @@ test.describe("prefetch=render", () => {
111111
await appFixture.close();
112112
});
113113

114-
test("does not render prefetch tags during SSR", async ({ page }) => {
114+
test.only("does not render prefetch tags during SSR", async ({ page }) => {
115115
let res = await fixture.requestDocument("/");
116116
expect(res.status).toBe(200);
117117
expect(await page.locator("#nav link").count()).toBe(0);
@@ -153,7 +153,7 @@ test.describe("prefetch=intent (hover)", () => {
153153
await appFixture.close();
154154
});
155155

156-
test("does not render prefetch tags during SSR", async ({ page }) => {
156+
test.only("does not render prefetch tags during SSR", async ({ page }) => {
157157
let res = await fixture.requestDocument("/");
158158
expect(res.status).toBe(200);
159159
expect(await page.locator("#nav link").count()).toBe(0);
@@ -224,7 +224,7 @@ test.describe("prefetch=intent (focus)", () => {
224224
await appFixture.close();
225225
});
226226

227-
test("does not render prefetch tags during SSR", async ({ page }) => {
227+
test.only("does not render prefetch tags during SSR", async ({ page }) => {
228228
let res = await fixture.requestDocument("/");
229229
expect(res.status).toBe(200);
230230
expect(await page.locator("#nav link").count()).toBe(0);

integration/rendering-test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ test.describe("rendering", () => {
4646

4747
test.afterAll(async () => appFixture.close());
4848

49-
test("server renders matching routes", async () => {
49+
test.only("server renders matching routes", async () => {
5050
let res = await fixture.requestDocument("/");
5151
expect(res.status).toBe(200);
5252
expect(selectHtml(await res.text(), "#content")).toBe(`<div id="content">

0 commit comments

Comments
 (0)