fix(POSTV1-02): 修复便携版网页入口门禁
Dada P0-A isolated Windows CI / validate-and-package (push) Waiting to run
Dada P0-A isolated Windows CI / validate-and-package (push) Waiting to run
This commit is contained in:
@@ -125,7 +125,12 @@ afterAll(async () => {
|
||||
|
||||
describe("TDD-WP0-BRW-001 supported browser contract", () => {
|
||||
it("cross-checks UA-CH and issues only a short-lived signed support cookie", async () => {
|
||||
const app = await createApp({ browserSupportRelease: testBrowserSupportRelease } as never);
|
||||
const app = await createApp({
|
||||
browserSupportRelease: testBrowserSupportRelease,
|
||||
productIndexHtml: "<!doctype html><title>Dada product test</title><div id=\"root\"></div>",
|
||||
} as never);
|
||||
const gate = await app.inject({ headers: { host: "127.0.0.1:43121" }, method: "GET", url: "/" });
|
||||
expect(gate.body).toContain("当前浏览器无法使用 Dada");
|
||||
const checked = await app.inject({
|
||||
headers: supportedEdge.headers,
|
||||
method: "POST",
|
||||
@@ -150,6 +155,14 @@ describe("TDD-WP0-BRW-001 supported browser contract", () => {
|
||||
|
||||
const cookie = supportCookie(checked);
|
||||
expect(cookie).toBeDefined();
|
||||
const productHtml = await app.inject({
|
||||
headers: { cookie, host: "127.0.0.1:43121", "sec-ch-ua": supportedEdge.headers["sec-ch-ua"] },
|
||||
method: "GET",
|
||||
url: "/app",
|
||||
});
|
||||
expect(productHtml.statusCode).toBe(200);
|
||||
expect(productHtml.body).toContain("Dada product test");
|
||||
expect(productHtml.body).not.toContain("当前浏览器无法使用 Dada");
|
||||
const product = await app.inject({
|
||||
headers: {
|
||||
cookie,
|
||||
|
||||
Reference in New Issue
Block a user