Skip to content

Commit

Permalink
Merge branch 'main' into image-slider-component
Browse files Browse the repository at this point in the history
  • Loading branch information
doubleedesign authored Sep 17, 2024
2 parents ba2e25d + 290454d commit bf945d4
Show file tree
Hide file tree
Showing 23 changed files with 946 additions and 26 deletions.
1 change: 1 addition & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ const config: StorybookConfig = {
'@storybook/addon-essentials',
'@storybook/addon-docs',
'@storybook/addon-a11y',
'@storybook/addon-actions',
'storybook-dark-mode',
'@storybook/addon-mdx-gfm'
],
Expand Down
3 changes: 3 additions & 0 deletions jest.setup.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import '@testing-library/jest-dom';
import { toHaveNoViolations } from 'jest-axe';

jest.mock('./src/providers/RedbackUiThemeProvider/GlobalStyle.tsx', () => ({
GlobalStyle: () => null
}));

// Ref: https://github.com/NickColley/jest-axe?tab=readme-ov-file#testing-react-with-react-testing-library
expect.extend(toHaveNoViolations);
10 changes: 6 additions & 4 deletions jest.utils.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { DiProvider, injectable } from 'react-magnetic-di';
import { DiProvider, Injectable, injectable } from 'react-magnetic-di';
import { ThemeProvider } from 'styled-components';
import { ReactNode } from 'react';
import { themes } from './src';
Expand All @@ -12,11 +12,13 @@ const commonDeps = [
];


export const renderWithDeps = (component: ReactNode) => {
export const renderWithDeps = (component: ReactNode, deps: Injectable[] = []) => {
return render(
<DiProvider use={commonDeps}>
<DiProvider use={[...commonDeps, ...deps]}>
<RedbackUiThemeProvider theme={themes.default}>
{component}
</RedbackUiThemeProvider>
</DiProvider>);
</DiProvider>
);
};

Loading

0 comments on commit bf945d4

Please sign in to comment.