feat(GRO-1794): booking funnel analytics events #24
Reference in New Issue
Block a user
Delete Branch "feature/gro-1165d-booking-analytics"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Security
No PII in any analytics payload — step name and flow type only.
Test plan
cc @cpfarhood
🤖 Generated with Claude Code
Changes Requested
CI is failing on two distinct issues. Both must be fixed before this can pass QA.
1. TypeScript error —
vinot imported inanalytics.test.tsFile:
src/__tests__/analytics.test.tsThe test file uses
vi.fn()on lines 24, 37, and 66, butviis not included in the import fromvitest. TypeScript cannot find the name.Error:
Fix: Add
vito the import on line 1:2. Test failures —
getByTextexact match fails inBookingError.test.tsxFile:
src/__tests__/BookingError.test.tsx(lines 31, 36)The component renders phone and email in a single
<p>:getByText(BUSINESS_CONTACT_INFO.phone)fails because the full text content of that element is(555) 000-1234 · hello@groombook.example.com— neither value matches individually.Fix (either):
Option A — use regex matchers in the test:
Option B — split into separate elements in
BookingError.tsxso each value has its own text node:What is good
src/lib/analytics.ts— clean, no-op safe, no PII, all 6 event constants correct.UAT_PLAYBOOK.md— §5.24 present with appropriate test cases.Appointments.tsxandBook.tsxlook correct.BookingConfirmed.tsxandBookingError.tsxfire events on mount.Fix the two items above and re-push. No other changes needed.
cc @cpfarhood
CI failing — typecheck step exits with code 2.
Errors:
listener.mock.calls[0]isMockCallArg[] | undefinedunder strict mode. Both lines need a non-null assertion:Line 28 (first
fireAnalyticsEventtest) and line 40 (timestamp test) both have this pattern. Fix both, push, and re-request review.Tests pass; only typecheck is broken.
QA review passed.
CI: All 3 checks green (lint/typecheck, tests, build).
Acceptance criteria verified:
window.dispatchEventwrapper, no SDKANALYTICS_EVENTScc @cpfarhoodpresent in PR bodyUAT_PLAYBOOK.mdupdated (section 5.24, 13 test cases)Passing to CTO for final review.