mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
fix: critical first-login soft-lock in usage survey overlay (#392)
* fix: prevent UsageSurveyOverlay from soft-locking the first-login password-change flow Claude-Session: https://claude.ai/code/session_01KAC9Lbx8AmebAnj9WQZXHp * fix: prevent double feedback submission when the settings write fails Claude-Session: https://claude.ai/code/session_01KAC9Lbx8AmebAnj9WQZXHp * refactor: consolidate feedback enums into packages/shared as a single source of truth Claude-Session: https://claude.ai/code/session_01KAC9Lbx8AmebAnj9WQZXHp * feat: add ARIA semantics, dismiss-button guard, and shared auth-route list to UsageSurveyOverlay Claude-Session: https://claude.ai/code/session_01KAC9Lbx8AmebAnj9WQZXHp * test: cover the submit-failure retry path and a persona-only minimal payload Claude-Session: https://claude.ai/code/session_01KAC9Lbx8AmebAnj9WQZXHp
This commit is contained in:
@@ -268,6 +268,27 @@ describe("captureFeedback", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("drops an empty important_areas array instead of forwarding it", async () => {
|
||||
bakedConfig.enabled = true;
|
||||
bakedConfig.posthogApiKey = "phc_test_key";
|
||||
await mod.initAnalytics();
|
||||
|
||||
await mod.captureFeedback(
|
||||
{
|
||||
source: "onboarding",
|
||||
survey_id: "onboarding-usage-v1",
|
||||
prompt_variant: "onboarding-overlay-v1",
|
||||
contact_ok: false,
|
||||
usage_type: "personal",
|
||||
important_areas: [],
|
||||
},
|
||||
"distinct-empty-areas",
|
||||
);
|
||||
|
||||
const properties = mockCapture.mock.calls.at(-1)?.[0].properties;
|
||||
expect(properties).not.toHaveProperty("important_areas");
|
||||
});
|
||||
|
||||
it("forwards search_query for a search_miss request", async () => {
|
||||
bakedConfig.enabled = true;
|
||||
bakedConfig.posthogApiKey = "phc_test_key";
|
||||
|
||||
Reference in New Issue
Block a user