mirror of
https://github.com/hanzoai/sentinel.git
synced 2026-09-29 22:34:33 +00:00
25 lines
642 B
TypeScript
25 lines
642 B
TypeScript
import {act, render, screen} from 'sentry-test/reactTestingLibrary';
|
|
|
|
import ConfigStore from 'sentry/stores/configStore';
|
|
import type {Config} from 'sentry/types';
|
|
import withConfig from 'sentry/utils/withConfig';
|
|
|
|
describe('withConfig HoC', function () {
|
|
beforeEach(() => {
|
|
ConfigStore.init();
|
|
});
|
|
|
|
it('adds config prop', function () {
|
|
function MyComponent({config}: {config: Config}) {
|
|
return <div>{config.dsn}</div>;
|
|
}
|
|
const Container = withConfig(MyComponent);
|
|
|
|
render(<Container />);
|
|
|
|
act(() => void ConfigStore.set('dsn', 'foo'));
|
|
|
|
expect(screen.getByText('foo')).toBeInTheDocument();
|
|
});
|
|
});
|