From 4341121ca41f1ce6b2eccdedc878cf097e794c20 Mon Sep 17 00:00:00 2001 From: Robbie Coomber Date: Fri, 3 Nov 2023 10:40:45 +0000 Subject: [PATCH] Fix tests --- src/__tests__/session-props.test.ts | 4 ++-- src/session-props.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/__tests__/session-props.test.ts b/src/__tests__/session-props.test.ts index 946aeeef1..4dd03d14e 100644 --- a/src/__tests__/session-props.test.ts +++ b/src/__tests__/session-props.test.ts @@ -1,4 +1,4 @@ -import { SessionPropsManager, StoredSessionSourceProps } from '../session-props' +import { SessionPropsManager, SessionSourceProps, StoredSessionSourceProps } from '../session-props' import { SessionIdManager } from '../sessionid' import { PostHogPersistence } from '../posthog-persistence' @@ -36,7 +36,7 @@ describe('Session Props Manager', () => { const utmSource = 'some-utm-source' const sessionId = 'session-id' const { onSessionId, generateProps, persistenceRegister } = createSessionPropsManager() - generateProps.mockReturnValue({ utm_source: utmSource }) + generateProps.mockReturnValue({ s: utmSource } as SessionSourceProps) const callback = onSessionId.mock.calls[0][0] // act diff --git a/src/session-props.ts b/src/session-props.ts index 739f760be..51799d777 100644 --- a/src/session-props.ts +++ b/src/session-props.ts @@ -14,7 +14,7 @@ import { CLIENT_SESSION_PROPS } from './constants' import { _strip_empty_properties } from './utils' // this might be stored in a cookie with a hard 4096 byte limit, so save characters on key names -interface SessionSourceProps { +export interface SessionSourceProps { p: string // initial pathname r: string // referring domain m?: string // utm medium