From 7a7a77bce60860d360cf11dd54cbd28d6e2f1a22 Mon Sep 17 00:00:00 2001 From: Michael Matloka Date: Thu, 23 Nov 2023 21:23:20 +0100 Subject: [PATCH] Expand `loadNotebooksContainingResource` Storybook mock --- frontend/src/mocks/handlers.ts | 14 ++++++++++++-- frontend/src/scenes/insights/Insights.stories.tsx | 10 ---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/frontend/src/mocks/handlers.ts b/frontend/src/mocks/handlers.ts index 7da9a39b575fb..4bc8241d88bd1 100644 --- a/frontend/src/mocks/handlers.ts +++ b/frontend/src/mocks/handlers.ts @@ -33,7 +33,17 @@ export const defaultMocks: Mocks = { '/api/projects/:team_id/event_definitions/': EMPTY_PAGINATED_RESPONSE, '/api/projects/:team_id/cohorts/': toPaginatedResponse([MOCK_DEFAULT_COHORT]), '/api/projects/:team_id/dashboards/': EMPTY_PAGINATED_RESPONSE, - '/api/projects/@current/dashboard_templates/repository/': [], + '/api/projects/:team_id/dashboard_templates/repository/': [], + '/api/projects/:team_id/notebooks': () => { + // this was matching on `?contains=query` but that made MSW unhappy and seems unnecessary + return [ + 200, + { + count: 0, + results: [], + }, + ] + }, '/api/projects/:team_id/groups/': EMPTY_PAGINATED_RESPONSE, '/api/projects/:team_id/groups_types/': [], '/api/projects/:team_id/insights/': EMPTY_PAGINATED_RESPONSE, @@ -44,7 +54,7 @@ export const defaultMocks: Mocks = { } as SharingConfigurationType, '/api/projects/:team_id/property_definitions/': EMPTY_PAGINATED_RESPONSE, '/api/projects/:team_id/feature_flags/': EMPTY_PAGINATED_RESPONSE, - 'api/projects/:team_id/feature_flags/:feature_flag_id/role_access': EMPTY_PAGINATED_RESPONSE, + '/api/projects/:team_id/feature_flags/:feature_flag_id/role_access': EMPTY_PAGINATED_RESPONSE, '/api/projects/:team_id/experiments/': EMPTY_PAGINATED_RESPONSE, '/api/projects/:team_id/explicit_members/': [], '/api/organizations/@current/': (): MockSignature => [ diff --git a/frontend/src/scenes/insights/Insights.stories.tsx b/frontend/src/scenes/insights/Insights.stories.tsx index ea0532b199365..41ada5331a87b 100644 --- a/frontend/src/scenes/insights/Insights.stories.tsx +++ b/frontend/src/scenes/insights/Insights.stories.tsx @@ -23,16 +23,6 @@ const meta: Meta = { '/api/projects/:team_id/persons/retention': sampleRetentionPeopleResponse, '/api/projects/:team_id/persons/properties': samplePersonProperties, '/api/projects/:team_id/groups_types': [], - '/api/projects/:team_id/notebooks': () => { - // this was matching on `?contains=query` but that made MSW unhappy and seems unnecessary - return [ - 200, - { - count: 0, - results: [], - }, - ] - }, }, post: { '/api/projects/:team_id/cohorts/': { id: 1 },