feat(onboarding): collect install method and friction area in the usage survey (#499)

Adds install method and hardest-setup-area as two optional questions to the first-login usage survey, so these fields are collected at onboarding scale instead of only via the low-traffic admin installer card. Both stay null until chosen and are omitted from the payload when unanswered. No API change and no new i18n; reuses the shared feedback schema and existing locale strings.
This commit is contained in:
SnapOtter
2026-07-11 16:46:28 +08:00
committed by GitHub
parent b457596649
commit 430b87eda0
2 changed files with 97 additions and 2 deletions
@@ -106,6 +106,33 @@ describe("UsageSurveyOverlay", () => {
});
});
it("includes install method and friction area when the admin selects them", async () => {
useAuth.mockReturnValue({ role: "admin", mustChangePassword: false });
apiGet.mockResolvedValue({ settings: {} });
renderOverlay();
await screen.findByText("How are you using SnapOtter?");
fireEvent.click(screen.getByRole("radio", { name: /Just me/ }));
fireEvent.click(screen.getByRole("radio", { name: "Built from source" }));
fireEvent.change(screen.getByLabelText("Hardest setup area"), {
target: { value: "docker" },
});
fireEvent.click(screen.getByRole("button", { name: "Continue" }));
await waitFor(() => {
expect(submitFeedback).toHaveBeenCalledWith({
source: "onboarding",
surveyId: "onboarding-usage-v1",
promptVariant: "onboarding-overlay-v1",
usageType: "personal",
importantAreas: [],
installMethod: "source",
frictionArea: "docker",
});
});
});
it("does not resubmit feedback if only the settings write failed on the first attempt", async () => {
useAuth.mockReturnValue({ role: "admin", mustChangePassword: false });
apiGet.mockResolvedValue({ settings: {} });