0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-24 00:47:50 +01:00
posthog/.storybook/app-context.ts
Michael Matloka f2522de038
feat(environments): Add new environments endpoint and move /projects to Project (#24154)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2024-09-11 14:05:56 +02:00

17 lines
779 B
TypeScript

import { MOCK_DEFAULT_TEAM, MOCK_DEFAULT_PROJECT } from 'lib/api.mock'
import { AppContext } from '~/types'
export const getStorybookAppContext = (): AppContext => ({
anonymous: false,
// 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`
current_team: MOCK_DEFAULT_TEAM,
current_project: MOCK_DEFAULT_PROJECT,
current_user: undefined as any, // `undefined` triggers a fetch and lets us mock the data
default_event_name: '$pageview',
persisted_feature_flags: [],
commit_sha: undefined,
preflight: null as any, // `null` triggers a fetch and lets us mock the data
switched_team: null,
})