Skip to content

Commit cf330f4

Browse files
authored
test: add snapshots for page errors (#3835)
1 parent 4a863d4 commit cf330f4

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

test/e2e/__snapshots__/magic-html.test.js.snap.webpack4

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ Array [
66
]
77
`;
88

9+
exports[`magicHtml option disabled should not handle GET request to magic async html: page errors 1`] = `Array []`;
10+
911
exports[`magicHtml option disabled should not handle GET request to magic async html: response headers content-type 1`] = `"text/html; charset=utf-8"`;
1012

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

21+
exports[`magicHtml option disabled should not handle HEAD request to magic async html: page errors 1`] = `Array []`;
22+
1923
exports[`magicHtml option disabled should not handle HEAD request to magic async html: response headers content-type 1`] = `"text/html; charset=utf-8"`;
2024

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

36+
exports[`magicHtml option enabled should handle GET request to magic async html: page errors 1`] = `Array []`;
37+
3238
exports[`magicHtml option enabled should handle GET request to magic async html: response headers content-type 1`] = `"text/html; charset=utf-8"`;
3339

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

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

44+
exports[`magicHtml option enabled should handle HEAD request to magic async html: page errors 1`] = `Array []`;
45+
3846
exports[`magicHtml option enabled should handle HEAD request to magic async html: response headers content-type 1`] = `"text/html; charset=utf-8"`;
3947

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

test/e2e/__snapshots__/magic-html.test.js.snap.webpack5

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ Array [
66
]
77
`;
88

9+
exports[`magicHtml option disabled should not handle GET request to magic async html: page errors 1`] = `Array []`;
10+
911
exports[`magicHtml option disabled should not handle GET request to magic async html: response headers content-type 1`] = `"text/html; charset=utf-8"`;
1012

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

21+
exports[`magicHtml option disabled should not handle HEAD request to magic async html: page errors 1`] = `Array []`;
22+
1923
exports[`magicHtml option disabled should not handle HEAD request to magic async html: response headers content-type 1`] = `"text/html; charset=utf-8"`;
2024

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

36+
exports[`magicHtml option enabled should handle GET request to magic async html: page errors 1`] = `Array []`;
37+
3238
exports[`magicHtml option enabled should handle GET request to magic async html: response headers content-type 1`] = `"text/html; charset=utf-8"`;
3339

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

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

44+
exports[`magicHtml option enabled should handle HEAD request to magic async html: page errors 1`] = `Array []`;
45+
3846
exports[`magicHtml option enabled should handle HEAD request to magic async html: response headers content-type 1`] = `"text/html; charset=utf-8"`;
3947

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

test/e2e/magic-html.test.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ describe("magicHtml option", () => {
5454
expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(
5555
"console messages"
5656
);
57+
58+
expect(pageErrors).toMatchSnapshot("page errors");
5759
});
5860

5961
it("should handle HEAD request to magic async html", async () => {
@@ -83,6 +85,8 @@ describe("magicHtml option", () => {
8385
expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(
8486
"console messages"
8587
);
88+
89+
expect(pageErrors).toMatchSnapshot("page errors");
8690
});
8791
});
8892

@@ -133,6 +137,8 @@ describe("magicHtml option", () => {
133137
expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(
134138
"console messages"
135139
);
140+
141+
expect(pageErrors).toMatchSnapshot("page errors");
136142
});
137143

138144
it("should not handle HEAD request to magic async html", async () => {
@@ -162,6 +168,8 @@ describe("magicHtml option", () => {
162168
expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(
163169
"console messages"
164170
);
171+
172+
expect(pageErrors).toMatchSnapshot("page errors");
165173
});
166174
});
167175
});

0 commit comments

Comments
 (0)