Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.
Go
test(onboarding): cover official source reporting controls (#4782)
Naiyuan Qingfc88c7720f29
diff --git a/packages/views/onboarding/source-backfill-modal.test.tsx b/packages/views/onboarding/source-backfill-modal.test.tsxindex 48275a5a12..b6b8e65977 100644--- a/packages/views/onboarding/source-backfill-modal.test.tsx+++ b/packages/views/onboarding/source-backfill-modal.test.tsx@@ -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",diff --git a/packages/views/onboarding/steps/step-source.test.tsx b/packages/views/onboarding/steps/step-source.test.tsxindex 6b6ee14a9d..03bbd04538 100644--- a/packages/views/onboarding/steps/step-source.test.tsx+++ b/packages/views/onboarding/steps/step-source.test.tsx@@ -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();