import { GamutProvider , theme } from '@codecademy/gamut-styles' ; import { setupEnzyme as setupEnzymeBase , setupRtl as setupRtlBase , } from 'component-test-setup' ; import { overArgs } from 'lodash' ; import React from 'react' ; export const MockGamutProvider = ( { children } ) => { return ( < GamutProvider useGlobals = { false } useCache = { false } theme = { theme } > { children } < /GamutProvider>); } ; function withMockGamutProvider < Props > ( WrappedComponent ) { const WithBoundaryComponent = ( props ) => ( < MockGamutProvider > < WrappedComponent { ... props } / > < /MockGamutProvider>); return WithBoundaryComponent ; } export const setupEnzyme = overArgs ( setupEnzymeBase , withMockGamutProvider ) as typeof setupEnzymeBase ; export const setupRtl = overArgs ( setupRtlBase , withMockGamutProvider ) as typeof setupRtlBase ;