2022-03-21 13:45:10 +01:00
|
|
|
import { MOCK_DEFAULT_TEAM } from 'lib/api.mock'
|
2024-03-08 01:31:35 +01:00
|
|
|
import { AppContext } from '~/types'
|
2022-03-16 09:14:16 +01:00
|
|
|
|
2022-03-21 13:45:10 +01:00
|
|
|
export const getStorybookAppContext = (): AppContext => ({
|
|
|
|
anonymous: false,
|
2024-03-08 01:31:35 +01:00
|
|
|
// Ideally we wouldn't set `current_team` here, the same way we don't set `current_user`, but unfortunately
|
|
|
|
// as of March 2024, a bunch of logics make the assumption that this is set, via `AppConfig`
|
2022-03-21 13:45:10 +01:00
|
|
|
current_team: MOCK_DEFAULT_TEAM,
|
2024-03-08 01:31:35 +01:00
|
|
|
current_user: undefined as any, // `undefined` triggers a fetch and lets us mock the data
|
2022-03-16 09:14:16 +01:00
|
|
|
default_event_name: '$pageview',
|
|
|
|
persisted_feature_flags: [],
|
2024-02-15 10:54:55 +01:00
|
|
|
commit_sha: undefined,
|
2024-03-08 01:31:35 +01:00
|
|
|
preflight: null as any, // `null` triggers a fetch and lets us mock the data
|
2022-03-21 13:45:10 +01:00
|
|
|
switched_team: null,
|
|
|
|
})
|