Skip to content

Commit

Permalink
mock theme in storybook
Browse files Browse the repository at this point in the history
  • Loading branch information
thmsobrmlr committed Dec 12, 2024
1 parent d8ed52c commit 70b3758
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
26 changes: 26 additions & 0 deletions frontend/src/lib/api.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { dayjs } from 'lib/dayjs'

import {
CohortType,
DataColorThemeModel,
FilterLogicalOperator,
GroupType,
OrganizationInviteType,
Expand Down Expand Up @@ -276,3 +277,28 @@ export const MOCK_DEFAULT_PLUGIN_CONFIG: PluginConfigWithPluginInfo = {
created_at: '2020-12-01T14:00:00.000Z',
plugin_info: MOCK_DEFAULT_PLUGIN,
}

export const MOCK_DATA_COLOR_THEMES: DataColorThemeModel[] = [
{
id: 1,
name: 'Default Theme',
colors: [
'#1d4aff',
'#621da6',
'#42827e',
'#ce0e74',
'#f14f58',
'#7c440e',
'#529a0a',
'#0476fb',
'#fe729e',
'#35416b',
'#41cbc4',
'#b64b02',
'#e4a604',
'#a56eff',
'#30d5c8',
],
is_global: true,
},
]
2 changes: 2 additions & 0 deletions frontend/src/mocks/handlers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {
MOCK_DATA_COLOR_THEMES,
MOCK_DEFAULT_COHORT,
MOCK_DEFAULT_ORGANIZATION,
MOCK_DEFAULT_ORGANIZATION_INVITE,
Expand Down Expand Up @@ -152,6 +153,7 @@ export const defaultMocks: Mocks = {
'/api/projects/:team_id/hog_function_templates': _hogFunctionTemplates,
'/api/projects/:team_id/hog_function_templates/:id': hogFunctionTemplateRetrieveMock,
'/api/projects/:team_id/hog_functions': EMPTY_PAGINATED_RESPONSE,
'/api/environments/:team_id/data_color_themes': MOCK_DATA_COLOR_THEMES,
},
post: {
'https://us.i.posthog.com/e/': (req, res, ctx): MockSignature => posthogCORSResponse(req, res, ctx),
Expand Down

0 comments on commit 70b3758

Please sign in to comment.