Skip to content

Commit

Permalink
fixes unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
HarveyPeachey committed Nov 4, 2024
1 parent e095635 commit d52af2d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/app/hooks/useOptimizelyMvtVariation/index.test.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react';
import { renderHook } from '#app/components/react-testing-library-with-providers';
import { RequestContextProvider } from '#contexts/RequestContext';
import { ToggleContextProvider } from '#contexts/ToggleContext';
import useOptimizelyMvtVariation from '.';
import * as activateExperiment from './activateExperiment';

Expand All @@ -22,7 +23,11 @@ describe('useOptimizelyMvtVariation custom hook', () => {
pathname: 'bar',
};
const wrapper = ({ children }) => (
<RequestContextProvider {...props}>{children}</RequestContextProvider>
<RequestContextProvider {...props}>
<ToggleContextProvider toggles={{ electionBanner: { enabled: true } }}>
{children}
</ToggleContextProvider>
</RequestContextProvider>
);
return renderHook(() => useOptimizelyMvtVariation(flagId), {
wrapper,
Expand Down

0 comments on commit d52af2d

Please sign in to comment.