Compare commits

...

1 Commits

Author SHA1 Message Date
Naiyuan Qing
80857eb300 test(onboarding): cover official source reporting controls 2026-07-01 14:13:32 +08:00
2 changed files with 36 additions and 0 deletions

View File

@@ -162,6 +162,26 @@ describe("SourceBackfillModal", () => {
).toBeChecked();
});
it("does not show reporting controls on the official API URL", async () => {
setUser({
id: "u1",
onboarded_at: "2026-01-01T00:00:00Z",
onboarding_questionnaire: { source: [] },
});
const user = userEvent.setup();
renderModal();
await user.click(await screen.findByText("Friends or colleagues"));
expect(
screen.queryByText(
"Help us understand how you heard about Multica. No extra information is sent.",
),
).not.toBeInTheDocument();
expect(
screen.queryByRole("switch", { name: /allow sending domain/i }),
).not.toBeInTheDocument();
});
it("Submit PATCHes the merged questionnaire preserving role / use_case", async () => {
setUser({
id: "u1",

View File

@@ -83,6 +83,22 @@ describe("StepSource (single-select primary source)", () => {
).toBeChecked();
});
it("does not show reporting controls on the official API URL", () => {
renderStep({
...EMPTY,
source: ["social_linkedin"],
});
expect(
screen.queryByText(
"Help us understand how you heard about Multica. No extra information is sent.",
),
).not.toBeInTheDocument();
expect(
screen.queryByRole("switch", { name: /allow sending domain/i }),
).not.toBeInTheDocument();
});
it("lets the user disable plaintext domain reporting", async () => {
setApiInstance(new ApiClient("https://api.customer.example"));
const user = userEvent.setup();