Skip to content

Commit

Permalink
Revert "Revert "Add .only to document request tests""
Browse files Browse the repository at this point in the history
This reverts commit 21f28d1.
  • Loading branch information
brophdawg11 committed Dec 1, 2022
1 parent 77e6254 commit 3c1a807
Show file tree
Hide file tree
Showing 13 changed files with 48 additions and 48 deletions.
6 changes: 3 additions & 3 deletions integration/action-test.ts
Expand Up @@ -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();
Expand All @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions integration/catch-boundary-data-test.ts
Expand Up @@ -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();
Expand All @@ -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();
Expand All @@ -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();
Expand Down
10 changes: 5 additions & 5 deletions integration/catch-boundary-test.ts
Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand Down
22 changes: 11 additions & 11 deletions integration/error-boundary-test.ts
Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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",
});
Expand All @@ -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",
});
Expand Down Expand Up @@ -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);
Expand All @@ -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",
});
Expand Down
8 changes: 4 additions & 4 deletions integration/form-data-test.ts
Expand Up @@ -24,15 +24,15 @@ 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" },
});
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" },
Expand All @@ -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" },
Expand All @@ -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" },
Expand Down
2 changes: 1 addition & 1 deletion integration/form-test.ts
Expand Up @@ -458,7 +458,7 @@ test.describe("Forms", () => {
await appFixture.close();
});

test.describe("without JavaScript", () => {
test.describe.only("without JavaScript", () => {
test.use({ javaScriptEnabled: false });

runFormTests();
Expand Down
6 changes: 3 additions & 3 deletions integration/headers-test.ts
Expand Up @@ -81,20 +81,20 @@ 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()
);
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";

Expand Down
6 changes: 3 additions & 3 deletions integration/path-mapping-test.ts
Expand Up @@ -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");
});
8 changes: 4 additions & 4 deletions integration/prefetch-test.ts
Expand Up @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion integration/rendering-test.ts
Expand Up @@ -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(`<div id="content">
Expand Down
2 changes: 1 addition & 1 deletion integration/resource-routes-test.ts
Expand Up @@ -106,7 +106,7 @@ test.describe("loader in an app", async () => {
runTests();
});

test.describe("without JavaScript", () => {
test.describe.only("without JavaScript", () => {
test.use({ javaScriptEnabled: false });
runTests();
});
Expand Down
16 changes: 8 additions & 8 deletions integration/splat-routes-test.ts
Expand Up @@ -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_$);
});
Expand Down
2 changes: 1 addition & 1 deletion integration/upload-test.ts
Expand Up @@ -237,7 +237,7 @@ test("can catch MaxPartSizeExceededError when file is too big with createMemoryU
expect(await app.getHtml("#size")).toMatch(">13<");
});

test.describe("without javascript", () => {
test.describe.only("without javascript", () => {
test.use({ javaScriptEnabled: false });

test("can upload a file with createFileUploadHandler", async ({ page }) => {
Expand Down

0 comments on commit 3c1a807

Please sign in to comment.