-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #908 from Sitecore/feature/add-testing
Feature/add testing
- Loading branch information
Showing
60 changed files
with
26,163 additions
and
13,786 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import type { StorybookConfig } from '@storybook/nextjs'; | ||
|
||
const config: StorybookConfig = { | ||
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'], | ||
addons: ['@storybook/addon-links', '@storybook/addon-essentials', '@chromatic-com/storybook', '@storybook/addon-interactions'], | ||
framework: { | ||
name: '@storybook/nextjs', | ||
options: {}, | ||
}, | ||
staticDirs: ['..\\public'], | ||
}; | ||
export default config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { addons } from '@storybook/manager-api'; | ||
import theme from './storybook-theme'; | ||
|
||
addons.setConfig({ | ||
theme, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { ChakraProvider, extendTheme } from '@chakra-ui/react'; | ||
import sitecoreTheme from '@sitecore/blok-theme'; | ||
import { withThemeByClassName } from '@storybook/addon-themes'; | ||
import type { Preview, ReactRenderer } from '@storybook/react'; | ||
import { initialize, mswLoader } from 'msw-storybook-addon'; | ||
import React from 'react'; | ||
import { PreviewProvider } from '../src/context/PreviewContext'; | ||
import { scdpTheme } from '../src/theme/theme'; | ||
|
||
initialize(); | ||
|
||
const preview: Preview = { | ||
parameters: { | ||
options: { | ||
storySort: { | ||
method: 'alphabetical', | ||
}, | ||
}, | ||
controls: { | ||
matchers: { | ||
color: /(background|color)$/i, | ||
date: /Date$/i, | ||
}, | ||
}, | ||
}, | ||
loaders: [mswLoader], | ||
decorators: [ | ||
withThemeByClassName<ReactRenderer>({ | ||
defaultTheme: 'light', | ||
themes: { | ||
light: 'light', | ||
dark: 'dark', | ||
}, | ||
}), | ||
(Story) => ( | ||
<ChakraProvider theme={extendTheme(sitecoreTheme, scdpTheme)}> | ||
<PreviewProvider hostname={''}> | ||
<Story /> | ||
</PreviewProvider> | ||
</ChakraProvider> | ||
), | ||
], | ||
}; | ||
export default preview; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { create } from '@storybook/theming'; | ||
|
||
export default create({ | ||
base: 'light', | ||
brandTitle: 'Sitecore Developer Portal', | ||
brandUrl: 'https://developers.sitecore.com', | ||
brandImage: 'https://delivery-sitecore.sitecorecontenthub.cloud/api/public/content/logo-sc_developers', | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.