Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .storybook/context-providers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ export const useChrome = () => {
resourceDefinitions: [],
},
]),
addWsEventListener: () => {
// Return unregister function that can be called on cleanup
return fn().mockName('unregister');
},
removeWsEventListener: fn().mockName('removeWsEventListener'),
...chromeConfig,
}),
[chromeConfig]
Expand Down
9 changes: 9 additions & 0 deletions .storybook/hooks/scalprum.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Mock @scalprum/react-core for Storybook
// Based on the Jest mock in EmptyNotifications.test.tsx

export const useRemoteHook = () => ({
hookResult: [null, null],
loading: false,
});

export const useLoadModule = () => [null, false];
1 change: 1 addition & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const config: StorybookConfig = {
'.storybook/hooks/useChrome'
),
'@unleash/proxy-client-react': path.resolve(process.cwd(), '.storybook/hooks/unleash'),
'@scalprum/react-core': path.resolve(process.cwd(), '.storybook/hooks/scalprum'),
},
fallback: {
...config.resolve?.fallback,
Expand Down
Loading
Loading