Skip to content

Commit

Permalink
fix: Add support for i18next in Cypress (#1411)
Browse files Browse the repository at this point in the history
  • Loading branch information
dreamoftrees authored Jan 25, 2024
1 parent cc63ac2 commit be43068
Showing 1 changed file with 17 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { ThemeProvider } from 'components/ThemeProvider/ThemeProvider';
import { withDefaultWidgetConfigs } from 'lib/withDefaultWidgetConfig';
import { Checkout, WidgetTheme } from '@imtbl/checkout-sdk';
import { CustomAnalyticsProvider } from 'context/analytics-provider/CustomAnalyticsProvider';
import { I18nextProvider } from 'react-i18next';
import i18n from '../../../i18n';

export interface TestProps {
children: React.ReactNode;
Expand All @@ -14,18 +16,20 @@ export function ViewContextTestComponent({ children, theme }: TestProps) {
theme: theme ?? WidgetTheme.DARK,
});
return (
<CustomAnalyticsProvider checkout={{} as Checkout}>
<ThemeProvider
id="test"
config={config}
globalSx={{
body: {
bg: 'base.color.neutral.800',
},
}}
>
{children}
</ThemeProvider>
</CustomAnalyticsProvider>
<I18nextProvider i18n={i18n}>
<CustomAnalyticsProvider checkout={{} as Checkout}>
<ThemeProvider
id="test"
config={config}
globalSx={{
body: {
bg: 'base.color.neutral.800',
},
}}
>
{children}
</ThemeProvider>
</CustomAnalyticsProvider>
</I18nextProvider>
);
}

0 comments on commit be43068

Please sign in to comment.