import {act, render, screen} from 'sentry-test/reactTestingLibrary'; import ConfigStore from 'sentry/stores/configStore'; import withConfig from 'sentry/utils/withConfig'; describe('withConfig HoC', function () { beforeEach(() => { ConfigStore.init(); }); afterEach(() => { ConfigStore.teardown(); }); it('adds config prop', function () { const MyComponent = ({config}) =>
{config.test}
; const Container = withConfig(MyComponent); render(); act(() => void ConfigStore.set('test', 'foo')); expect(screen.getByText('foo')).toBeInTheDocument(); }); });