From 49429d46b905ba6e2bde518232a46449395ec44e Mon Sep 17 00:00:00 2001 From: Matt Brophy Date: Wed, 23 Nov 2022 10:54:15 -0500 Subject: [PATCH] Add .only to document request tests --- integration/action-test.ts | 6 +++--- integration/catch-boundary-data-test.ts | 6 +++--- integration/catch-boundary-test.ts | 10 +++++----- integration/error-boundary-test.ts | 22 +++++++++++----------- integration/form-data-test.ts | 8 ++++---- integration/headers-test.ts | 6 +++--- integration/path-mapping-test.ts | 6 +++--- integration/prefetch-test.ts | 8 ++++---- integration/rendering-test.ts | 2 +- integration/splat-routes-test.ts | 16 ++++++++-------- 10 files changed, 45 insertions(+), 45 deletions(-) diff --git a/integration/action-test.ts b/integration/action-test.ts index b93f69464e2..2505100f53d 100644 --- a/integration/action-test.ts +++ b/integration/action-test.ts @@ -87,13 +87,13 @@ test.describe("actions", () => { expect(logs).toHaveLength(0); }); - test("is not called on document GET requests", async () => { + test.only("is not called on document GET requests", async () => { let res = await fixture.requestDocument("/urlencoded"); let html = selectHtml(await res.text(), "#text"); expect(html).toMatch(WAITING_VALUE); }); - test("is called on document POST requests", async () => { + test.only("is called on document POST requests", async () => { let FIELD_VALUE = "cheeseburger"; let params = new URLSearchParams(); @@ -115,7 +115,7 @@ test.describe("actions", () => { await page.waitForSelector(`#text:has-text("${SUBMITTED_VALUE}")`); }); - test("redirects a thrown response on document requests", async () => { + test.only("redirects a thrown response on document requests", async () => { let params = new URLSearchParams(); let res = await fixture.postDocument(`/${THROWS_REDIRECT}`, params); expect(res.status).toBe(302); diff --git a/integration/catch-boundary-data-test.ts b/integration/catch-boundary-data-test.ts index c4fe602f86a..f5465327e86 100644 --- a/integration/catch-boundary-data-test.ts +++ b/integration/catch-boundary-data-test.ts @@ -158,7 +158,7 @@ test.beforeAll(async () => { test.afterAll(async () => appFixture.close()); -test("renders root boundary with data available", async () => { +test.only("renders root boundary with data available", async () => { let res = await fixture.requestDocument(NO_BOUNDARY_LOADER); expect(res.status).toBe(401); let html = await res.text(); @@ -176,7 +176,7 @@ test("renders root boundary with data available on transition", async ({ await page.waitForSelector(`#root-boundary-data:has-text("${ROOT_DATA}")`); }); -test("renders layout boundary with data available", async () => { +test.only("renders layout boundary with data available", async () => { let res = await fixture.requestDocument(HAS_BOUNDARY_LAYOUT_NESTED_LOADER); expect(res.status).toBe(401); let html = await res.text(); @@ -200,7 +200,7 @@ test("renders layout boundary with data available on transition", async ({ ); }); -test("renders self boundary with layout data available", async () => { +test.only("renders self boundary with layout data available", async () => { let res = await fixture.requestDocument(HAS_BOUNDARY_NESTED_LOADER); expect(res.status).toBe(401); let html = await res.text(); diff --git a/integration/catch-boundary-test.ts b/integration/catch-boundary-test.ts index 82932111b7c..9b6b9cde61d 100644 --- a/integration/catch-boundary-test.ts +++ b/integration/catch-boundary-test.ts @@ -185,7 +185,7 @@ test.describe("CatchBoundary", () => { test.afterAll(() => appFixture.close()); - test("non-matching urls on document requests", async () => { + test.only("non-matching urls on document requests", async () => { let res = await fixture.requestDocument(NOT_FOUND_HREF); expect(res.status).toBe(404); expect(await res.text()).toMatch(ROOT_BOUNDARY_TEXT); @@ -198,7 +198,7 @@ test.describe("CatchBoundary", () => { await page.waitForSelector("#root-boundary"); }); - test("own boundary, action, document request", async () => { + test.only("own boundary, action, document request", async () => { let params = new URLSearchParams(); let res = await fixture.postDocument(HAS_BOUNDARY_ACTION, params); expect(res.status).toBe(401); @@ -223,7 +223,7 @@ test.describe("CatchBoundary", () => { await page.waitForSelector("#action-boundary"); }); - test("bubbles to parent in action document requests", async () => { + test.only("bubbles to parent in action document requests", async () => { let params = new URLSearchParams(); let res = await fixture.postDocument(NO_BOUNDARY_ACTION, params); expect(res.status).toBe(401); @@ -248,7 +248,7 @@ test.describe("CatchBoundary", () => { await page.waitForSelector("#root-boundary"); }); - test("own boundary, loader, document request", async () => { + test.only("own boundary, loader, document request", async () => { let res = await fixture.requestDocument(HAS_BOUNDARY_LOADER); expect(res.status).toBe(401); expect(await res.text()).toMatch(OWN_BOUNDARY_TEXT); @@ -261,7 +261,7 @@ test.describe("CatchBoundary", () => { await page.waitForSelector("#boundary-loader"); }); - test("bubbles to parent in loader document requests", async () => { + test.only("bubbles to parent in loader document requests", async () => { let res = await fixture.requestDocument(NO_BOUNDARY_LOADER); expect(res.status).toBe(401); expect(await res.text()).toMatch(ROOT_BOUNDARY_TEXT); diff --git a/integration/error-boundary-test.ts b/integration/error-boundary-test.ts index 2c3f42742f4..2a098f00c1a 100644 --- a/integration/error-boundary-test.ts +++ b/integration/error-boundary-test.ts @@ -286,13 +286,13 @@ test.describe("ErrorBoundary", () => { await appFixture.close(); }); - test("invalid request methods", async () => { + test.only("invalid request methods", async () => { let res = await fixture.requestDocument("/", { method: "OPTIONS" }); expect(res.status).toBe(405); expect(await res.text()).toMatch(ROOT_BOUNDARY_TEXT); }); - test("own boundary, action, document request", async () => { + test.only("own boundary, action, document request", async () => { let params = new URLSearchParams(); let res = await fixture.postDocument(HAS_BOUNDARY_ACTION, params); expect(res.status).toBe(500); @@ -319,7 +319,7 @@ test.describe("ErrorBoundary", () => { expect(await app.getHtml("main")).toMatch(OWN_BOUNDARY_TEXT); }); - test("bubbles to parent in action document requests", async () => { + test.only("bubbles to parent in action document requests", async () => { let params = new URLSearchParams(); let res = await fixture.postDocument(NO_BOUNDARY_ACTION, params); expect(res.status).toBe(500); @@ -344,7 +344,7 @@ test.describe("ErrorBoundary", () => { expect(await app.getHtml("main")).toMatch(ROOT_BOUNDARY_TEXT); }); - test("own boundary, loader, document request", async () => { + test.only("own boundary, loader, document request", async () => { let res = await fixture.requestDocument(HAS_BOUNDARY_LOADER); expect(res.status).toBe(500); expect(await res.text()).toMatch(OWN_BOUNDARY_TEXT); @@ -357,7 +357,7 @@ test.describe("ErrorBoundary", () => { expect(await app.getHtml("main")).toMatch(OWN_BOUNDARY_TEXT); }); - test("bubbles to parent in loader document requests", async () => { + test.only("bubbles to parent in loader document requests", async () => { let res = await fixture.requestDocument(NO_BOUNDARY_LOADER); expect(res.status).toBe(500); expect(await res.text()).toMatch(ROOT_BOUNDARY_TEXT); @@ -372,7 +372,7 @@ test.describe("ErrorBoundary", () => { expect(await app.getHtml("main")).toMatch(ROOT_BOUNDARY_TEXT); }); - test("ssr rendering errors with no boundary", async () => { + test.only("ssr rendering errors with no boundary", async () => { let res = await fixture.requestDocument(NO_BOUNDARY_RENDER); expect(res.status).toBe(500); expect(await res.text()).toMatch(ROOT_BOUNDARY_TEXT); @@ -387,7 +387,7 @@ test.describe("ErrorBoundary", () => { expect(await app.getHtml("main")).toMatch(ROOT_BOUNDARY_TEXT); }); - test("ssr rendering errors with boundary", async () => { + test.only("ssr rendering errors with boundary", async () => { let res = await fixture.requestDocument(HAS_BOUNDARY_RENDER); expect(res.status).toBe(500); expect(await res.text()).toMatch(OWN_BOUNDARY_TEXT); @@ -432,7 +432,7 @@ test.describe("ErrorBoundary", () => { await page.waitForSelector("#root-boundary"); }); - test("renders root boundary in document POST without action requests", async () => { + test.only("renders root boundary in document POST without action requests", async () => { let res = await fixture.requestDocument(NO_BOUNDARY_NO_LOADER_OR_ACTION, { method: "post", }); @@ -449,7 +449,7 @@ test.describe("ErrorBoundary", () => { await page.waitForSelector("#root-boundary"); }); - test("renders own boundary in document POST without action requests", async () => { + test.only("renders own boundary in document POST without action requests", async () => { let res = await fixture.requestDocument(HAS_BOUNDARY_NO_LOADER_OR_ACTION, { method: "post", }); @@ -595,7 +595,7 @@ test.describe("ErrorBoundary", () => { expect(await app.getHtml("h1")).toMatch(INTERNAL_ERROR_BOUNDARY_HEADING); }); - test("bubbles to internal boundary if loader doesn't return (document requests)", async () => { + test.only("bubbles to internal boundary if loader doesn't return (document requests)", async () => { let res = await fixture.requestDocument(NO_ROOT_BOUNDARY_LOADER_RETURN); expect(res.status).toBe(500); expect(await res.text()).toMatch(INTERNAL_ERROR_BOUNDARY_HEADING); @@ -611,7 +611,7 @@ test.describe("ErrorBoundary", () => { expect(await app.getHtml("h1")).toMatch(INTERNAL_ERROR_BOUNDARY_HEADING); }); - test("bubbles to internal boundary if action doesn't return (document requests)", async () => { + test.only("bubbles to internal boundary if action doesn't return (document requests)", async () => { let res = await fixture.requestDocument(NO_ROOT_BOUNDARY_ACTION_RETURN, { method: "post", }); diff --git a/integration/form-data-test.ts b/integration/form-data-test.ts index 578491bba33..c1eceaf774e 100644 --- a/integration/form-data-test.ts +++ b/integration/form-data-test.ts @@ -24,7 +24,7 @@ test.beforeAll(async () => { }); }); -test("invalid content-type does not crash server", async () => { +test.only("invalid content-type does not crash server", async () => { let response = await fixture.requestDocument("/", { method: "post", headers: { "content-type": "application/json" }, @@ -32,7 +32,7 @@ test("invalid content-type does not crash server", async () => { expect(await response.text()).toMatch("no pizza"); }); -test("invalid urlencoded body does not crash server", async () => { +test.only("invalid urlencoded body does not crash server", async () => { let response = await fixture.requestDocument("/", { method: "post", headers: { "content-type": "application/x-www-form-urlencoded" }, @@ -41,7 +41,7 @@ test("invalid urlencoded body does not crash server", async () => { expect(await response.text()).toMatch("pizza"); }); -test("invalid multipart content-type does not crash server", async () => { +test.only("invalid multipart content-type does not crash server", async () => { let response = await fixture.requestDocument("/", { method: "post", headers: { "content-type": "multipart/form-data" }, @@ -50,7 +50,7 @@ test("invalid multipart content-type does not crash server", async () => { expect(await response.text()).toMatch("pizza"); }); -test("invalid multipart body does not crash server", async () => { +test.only("invalid multipart body does not crash server", async () => { let response = await fixture.requestDocument("/", { method: "post", headers: { "content-type": "multipart/form-data; boundary=abc" }, diff --git a/integration/headers-test.ts b/integration/headers-test.ts index ae524d6b4c3..1d9139d78b4 100644 --- a/integration/headers-test.ts +++ b/integration/headers-test.ts @@ -81,7 +81,7 @@ test.describe("headers export", () => { }); }); - test("can use `action` headers", async () => { + test.only("can use `action` headers", async () => { let response = await appFixture.postDocument( "/action", new URLSearchParams() @@ -89,12 +89,12 @@ test.describe("headers export", () => { expect(response.headers.get(ACTION_HKEY)).toBe(ACTION_HVALUE); }); - test("can use the loader headers when all routes have loaders", async () => { + test.only("can use the loader headers when all routes have loaders", async () => { let response = await appFixture.requestDocument("/"); expect(response.headers.get(ROOT_HEADER_KEY)).toBe(ROOT_HEADER_VALUE); }); - test("can use the loader headers when parents don't have loaders", async () => { + test.only("can use the loader headers when parents don't have loaders", async () => { let HEADER_KEY = "X-Test"; let HEADER_VALUE = "SUCCESS"; diff --git a/integration/path-mapping-test.ts b/integration/path-mapping-test.ts index 4b2f76e7d13..855a016bdfd 100644 --- a/integration/path-mapping-test.ts +++ b/integration/path-mapping-test.ts @@ -100,18 +100,18 @@ test.beforeAll(async () => { }); }); -test("import internal library via alias other than ~", async () => { +test.only("import internal library via alias other than ~", async () => { // test for https://github.com/remix-run/remix/issues/2298 let response = await fixture.requestDocument("/"); expect(await response.text()).toMatch("this is a pizza"); }); -test("import internal library via ~ alias", async () => { +test.only("import internal library via ~ alias", async () => { let response = await fixture.requestDocument("/tilde-alias"); expect(await response.text()).toMatch("this is a pizza"); }); -test("works for mdx files", async () => { +test.only("works for mdx files", async () => { let response = await fixture.requestDocument("/mdx"); expect(await response.text()).toMatch("this is a pizza"); }); diff --git a/integration/prefetch-test.ts b/integration/prefetch-test.ts index f21291481f7..bc3ea02a5ff 100644 --- a/integration/prefetch-test.ts +++ b/integration/prefetch-test.ts @@ -85,7 +85,7 @@ test.describe("prefetch=none", () => { test.afterAll(() => appFixture.close()); - test("does not render prefetch tags during SSR", async ({ page }) => { + test.only("does not render prefetch tags during SSR", async ({ page }) => { let res = await fixture.requestDocument("/"); expect(res.status).toBe(200); expect(await page.locator("#nav link").count()).toBe(0); @@ -111,7 +111,7 @@ test.describe("prefetch=render", () => { await appFixture.close(); }); - test("does not render prefetch tags during SSR", async ({ page }) => { + test.only("does not render prefetch tags during SSR", async ({ page }) => { let res = await fixture.requestDocument("/"); expect(res.status).toBe(200); expect(await page.locator("#nav link").count()).toBe(0); @@ -153,7 +153,7 @@ test.describe("prefetch=intent (hover)", () => { await appFixture.close(); }); - test("does not render prefetch tags during SSR", async ({ page }) => { + test.only("does not render prefetch tags during SSR", async ({ page }) => { let res = await fixture.requestDocument("/"); expect(res.status).toBe(200); expect(await page.locator("#nav link").count()).toBe(0); @@ -224,7 +224,7 @@ test.describe("prefetch=intent (focus)", () => { await appFixture.close(); }); - test("does not render prefetch tags during SSR", async ({ page }) => { + test.only("does not render prefetch tags during SSR", async ({ page }) => { let res = await fixture.requestDocument("/"); expect(res.status).toBe(200); expect(await page.locator("#nav link").count()).toBe(0); diff --git a/integration/rendering-test.ts b/integration/rendering-test.ts index 3a4fd4ecf3f..4ad95eff71c 100644 --- a/integration/rendering-test.ts +++ b/integration/rendering-test.ts @@ -46,7 +46,7 @@ test.describe("rendering", () => { test.afterAll(async () => appFixture.close()); - test("server renders matching routes", async () => { + test.only("server renders matching routes", async () => { let res = await fixture.requestDocument("/"); expect(res.status).toBe(200); expect(selectHtml(await res.text(), "#content")).toBe(`
diff --git a/integration/splat-routes-test.ts b/integration/splat-routes-test.ts index 59f5359f340..d8ee7e71f0b 100644 --- a/integration/splat-routes-test.ts +++ b/integration/splat-routes-test.ts @@ -87,42 +87,42 @@ test.describe("rendering", () => { }); }); - test("flat exact match", async () => { + test.only("flat exact match", async () => { let res = await fixture.requestDocument("/flat"); expect(await res.text()).toMatch(FLAT_$); }); - test("flat deep match", async () => { + test.only("flat deep match", async () => { let res = await fixture.requestDocument("/flat/swig"); expect(await res.text()).toMatch(FLAT_$); }); - test("prioritizes index over root splat", async () => { + test.only("prioritizes index over root splat", async () => { let res = await fixture.requestDocument("/"); expect(await res.text()).toMatch(ROOT_INDEX); }); - test("matches root splat", async () => { + test.only("matches root splat", async () => { let res = await fixture.requestDocument("/twisted/sugar"); expect(await res.text()).toMatch(ROOT_$); }); - test("prioritizes index over splat for parent route match", async () => { + test.only("prioritizes index over splat for parent route match", async () => { let res = await fixture.requestDocument("/nested"); expect(await res.text()).toMatch(NESTED_INDEX); }); - test("nested child", async () => { + test.only("nested child", async () => { let res = await fixture.requestDocument("/nested/sodalicious"); expect(await res.text()).toMatch(NESTED_$); }); - test("parentless exact match", async () => { + test.only("parentless exact match", async () => { let res = await fixture.requestDocument("/parentless"); expect(await res.text()).toMatch(PARENTLESS_$); }); - test("parentless deep match", async () => { + test.only("parentless deep match", async () => { let res = await fixture.requestDocument("/parentless/chip"); expect(await res.text()).toMatch(PARENTLESS_$); });