feat: add PostHog customer feedback

This commit is contained in:
SnapOtter
2026-06-29 18:16:33 +08:00
parent 6f85b3d12a
commit 649e65b035
47 changed files with 3937 additions and 4 deletions
+7 -2
View File
@@ -2,8 +2,8 @@ import { ANALYTICS_EVENTS } from "@snapotter/shared";
import { describe, expect, it } from "vitest";
describe("ANALYTICS_EVENTS", () => {
it("has exactly 12 event keys", () => {
expect(Object.keys(ANALYTICS_EVENTS)).toHaveLength(12);
it("has exactly 13 event keys", () => {
expect(Object.keys(ANALYTICS_EVENTS)).toHaveLength(13);
});
it("contains the expected keys", () => {
@@ -19,6 +19,7 @@ describe("ANALYTICS_EVENTS", () => {
expect(ANALYTICS_EVENTS).toHaveProperty("AI_BUNDLE_ACTION");
expect(ANALYTICS_EVENTS).toHaveProperty("AI_BUNDLE_PROMPTED");
expect(ANALYTICS_EVENTS).toHaveProperty("BATCH_PROCESSED");
expect(ANALYTICS_EVENTS).toHaveProperty("FEEDBACK_SUBMITTED");
});
it("all event values are strings", () => {
@@ -43,6 +44,10 @@ describe("ANALYTICS_EVENTS", () => {
expect(ANALYTICS_EVENTS.AI_BUNDLE_ACTION).toBe("ai_bundle_action");
});
it("FEEDBACK_SUBMITTED has the correct snake_case value", () => {
expect(ANALYTICS_EVENTS.FEEDBACK_SUBMITTED).toBe("feedback_submitted");
});
it("all values follow snake_case convention", () => {
for (const value of Object.values(ANALYTICS_EVENTS)) {
expect(value).toMatch(/^[a-z][a-z0-9_]*$/);