Skip to content

Commit

Permalink
test: add snapshots for page errors (#3835)
Browse files Browse the repository at this point in the history
  • Loading branch information
snitin315 authored Sep 12, 2021
1 parent 4a863d4 commit cf330f4
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/e2e/__snapshots__/magic-html.test.js.snap.webpack4
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Array [
]
`;

exports[`magicHtml option disabled should not handle GET request to magic async html: page errors 1`] = `Array []`;

exports[`magicHtml option disabled should not handle GET request to magic async html: response headers content-type 1`] = `"text/html; charset=utf-8"`;

exports[`magicHtml option disabled should not handle GET request to magic async html: response status 1`] = `404`;
Expand All @@ -16,6 +18,8 @@ Array [
]
`;

exports[`magicHtml option disabled should not handle HEAD request to magic async html: page errors 1`] = `Array []`;

exports[`magicHtml option disabled should not handle HEAD request to magic async html: response headers content-type 1`] = `"text/html; charset=utf-8"`;

exports[`magicHtml option disabled should not handle HEAD request to magic async html: response status 1`] = `404`;
Expand All @@ -29,12 +33,16 @@ Array [
]
`;

exports[`magicHtml option enabled should handle GET request to magic async html: page errors 1`] = `Array []`;

exports[`magicHtml option enabled should handle GET request to magic async html: response headers content-type 1`] = `"text/html; charset=utf-8"`;

exports[`magicHtml option enabled should handle GET request to magic async html: response status 1`] = `200`;

exports[`magicHtml option enabled should handle HEAD request to magic async html: console messages 1`] = `Array []`;

exports[`magicHtml option enabled should handle HEAD request to magic async html: page errors 1`] = `Array []`;

exports[`magicHtml option enabled should handle HEAD request to magic async html: response headers content-type 1`] = `"text/html; charset=utf-8"`;

exports[`magicHtml option enabled should handle HEAD request to magic async html: response status 1`] = `200`;
8 changes: 8 additions & 0 deletions test/e2e/__snapshots__/magic-html.test.js.snap.webpack5
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Array [
]
`;

exports[`magicHtml option disabled should not handle GET request to magic async html: page errors 1`] = `Array []`;

exports[`magicHtml option disabled should not handle GET request to magic async html: response headers content-type 1`] = `"text/html; charset=utf-8"`;

exports[`magicHtml option disabled should not handle GET request to magic async html: response status 1`] = `404`;
Expand All @@ -16,6 +18,8 @@ Array [
]
`;

exports[`magicHtml option disabled should not handle HEAD request to magic async html: page errors 1`] = `Array []`;

exports[`magicHtml option disabled should not handle HEAD request to magic async html: response headers content-type 1`] = `"text/html; charset=utf-8"`;

exports[`magicHtml option disabled should not handle HEAD request to magic async html: response status 1`] = `404`;
Expand All @@ -29,12 +33,16 @@ Array [
]
`;

exports[`magicHtml option enabled should handle GET request to magic async html: page errors 1`] = `Array []`;

exports[`magicHtml option enabled should handle GET request to magic async html: response headers content-type 1`] = `"text/html; charset=utf-8"`;

exports[`magicHtml option enabled should handle GET request to magic async html: response status 1`] = `200`;

exports[`magicHtml option enabled should handle HEAD request to magic async html: console messages 1`] = `Array []`;

exports[`magicHtml option enabled should handle HEAD request to magic async html: page errors 1`] = `Array []`;

exports[`magicHtml option enabled should handle HEAD request to magic async html: response headers content-type 1`] = `"text/html; charset=utf-8"`;

exports[`magicHtml option enabled should handle HEAD request to magic async html: response status 1`] = `200`;
8 changes: 8 additions & 0 deletions test/e2e/magic-html.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ describe("magicHtml option", () => {
expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(
"console messages"
);

expect(pageErrors).toMatchSnapshot("page errors");
});

it("should handle HEAD request to magic async html", async () => {
Expand Down Expand Up @@ -83,6 +85,8 @@ describe("magicHtml option", () => {
expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(
"console messages"
);

expect(pageErrors).toMatchSnapshot("page errors");
});
});

Expand Down Expand Up @@ -133,6 +137,8 @@ describe("magicHtml option", () => {
expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(
"console messages"
);

expect(pageErrors).toMatchSnapshot("page errors");
});

it("should not handle HEAD request to magic async html", async () => {
Expand Down Expand Up @@ -162,6 +168,8 @@ describe("magicHtml option", () => {
expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(
"console messages"
);

expect(pageErrors).toMatchSnapshot("page errors");
});
});
});

0 comments on commit cf330f4

Please sign in to comment.