0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-24 09:14:46 +01:00
posthog/.storybook/app-context.ts
Raquel Smith 41ebc6efc3
fix: access removed state (#20673)
* fix access removed state

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `chromium` (2)

* draft stories

* Update UI snapshots for `chromium` (1)

* Remove `POSTHOG_APP_CONTEXT` from Storybook

* Update UI snapshots for `chromium` (2)

* Fix up stories

* app-context is req'd for feature flags, but we just don't want the default team

* Just fix the "Error Project Unavailable" stories

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `webkit` (2)

* Update UI snapshots for `webkit` (2)

* Update UI snapshots for `webkit` (2)

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `chromium` (2)

* fix typo

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `chromium` (2)

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Michael Matloka <michal@matloka.com>
Co-authored-by: Michael Matloka <dev@twixes.com>
2024-03-08 00:31:35 +00:00

16 lines
714 B
TypeScript

import { MOCK_DEFAULT_TEAM } 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_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,
})