Skip to content

Commit d534a30

Browse files
committed
Updates sandbox event tracking
Updates the sandbox event that is tracked when the iframe loads to `sandbox_open`. This more accurately reflects the user's action of opening the sandbox and aligns with the new event naming conventions.
1 parent 378c57c commit d534a30

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/components/lab-embed/embed-element/__tests__/embed-element.test.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ vi.mock('next/router', () => ({
2222
vi.mock('lib/posthog-events', () => ({
2323
trackSandboxEvent: vi.fn(),
2424
SANDBOX_EVENT: {
25+
SANDBOX_STARTED: 'sandbox_started',
26+
SANDBOX_OPEN: 'sandbox_open',
27+
SANDBOX_CLOSED: 'sandbox_closed',
2528
SANDBOX_LOADED: 'sandbox_loaded',
2629
SANDBOX_ERROR: 'sandbox_error',
2730
SANDBOX_RETRY: 'sandbox_retry',
@@ -133,7 +136,7 @@ describe('EmbedElement', () => {
133136
screen.queryByText('Loading your sandbox...')
134137
).not.toBeInTheDocument()
135138

136-
expect(mockTrackSandboxEvent).toHaveBeenCalledWith('sandbox_loaded', {
139+
expect(mockTrackSandboxEvent).toHaveBeenCalledWith('sandbox_open', {
137140
labId: 'test-lab-id',
138141
page: '/test-path',
139142
})

0 commit comments

Comments
 (0)