Skip to content

Commit

Permalink
Atomic components stories (#1422)
Browse files Browse the repository at this point in the history
  • Loading branch information
claudiaHash authored May 23, 2022
1 parent 9027fc1 commit 6d2dea8
Show file tree
Hide file tree
Showing 63 changed files with 10,760 additions and 5,235 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,4 +127,5 @@ jobs:
restore-keys: ${{ runner.os }}-${{ matrix.node }}-storybook-${{ env.cache-name }}-

- run: npm ci
- run: npm run pregenerate
- run: npm run storybook:build
13 changes: 13 additions & 0 deletions .jest/__mocks__/matchMedia.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Object.defineProperty(window, 'matchMedia', {
writable: true,
value: jest.fn().mockImplementation((query) => ({
matches: false,
media: query,
onchange: null,
addListener: jest.fn(), // deprecated
removeListener: jest.fn(), // deprecated
addEventListener: jest.fn(),
removeEventListener: jest.fn(),
dispatchEvent: jest.fn()
}))
})
1 change: 1 addition & 0 deletions .jest/jest.setup.js
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
import '@testing-library/jest-dom/extend-expect'
import './__mocks__/matchMedia'
8 changes: 7 additions & 1 deletion .storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin')

const webpack = require('webpack')
module.exports = {
core: { builder: 'webpack5' },
stories: ['../src/**/*.stories.tsx'],
Expand Down Expand Up @@ -47,6 +47,12 @@ module.exports = {
})
config.resolve.fallback = fallback

config.plugins = (config.plugins || []).concat([
new webpack.ProvidePlugin({
process: 'process/browser',
Buffer: ['buffer', 'Buffer']
})
])
return config
}
}
2 changes: 1 addition & 1 deletion .storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const parameters = {
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/
date: /date$/
}
}
}
Loading

0 comments on commit 6d2dea8

Please sign in to comment.