You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
838 B
30 lines
838 B
import { describe, expect, it } from "vitest";
|
|
import {
|
|
isPostSubmitDestination,
|
|
POST_SUBMIT_URL_PATTERN,
|
|
} from "@/workers/rpa/quote-capture/post-submit-navigation";
|
|
|
|
describe("post-submit navigation", () => {
|
|
it("sign-up-quote 为合法落点", () => {
|
|
expect(
|
|
isPostSubmitDestination(
|
|
"https://www.mothership.com/sign-up-quote?quote-details=abc",
|
|
),
|
|
).toBe(true);
|
|
});
|
|
|
|
it("/quote 路径为合法落点", () => {
|
|
expect(
|
|
isPostSubmitDestination("https://www.mothership.com/quote/results"),
|
|
).toBe(true);
|
|
});
|
|
|
|
it("首页不是合法落点", () => {
|
|
expect(isPostSubmitDestination("https://www.mothership.com/")).toBe(false);
|
|
});
|
|
|
|
it("POST_SUBMIT_URL_PATTERN 覆盖 sign-up-quote", () => {
|
|
expect(POST_SUBMIT_URL_PATTERN.test("sign-up-quote?x=1")).toBe(true);
|
|
});
|
|
});
|