mirror of
https://github.com/hanzoai/sentinel.git
synced 2026-09-29 22:34:33 +00:00
28 lines
777 B
TypeScript
28 lines
777 B
TypeScript
import selectEvent from 'react-select-event';
|
|
import {ProjectFixture} from 'sentry-fixture/project';
|
|
|
|
import {render, screen} from 'sentry-test/reactTestingLibrary';
|
|
|
|
import SentryProjectSelectorField from './sentryProjectSelectorField';
|
|
|
|
describe('SentryProjectSelectorField', () => {
|
|
it('can change values', async () => {
|
|
const mock = jest.fn();
|
|
const projects = [
|
|
ProjectFixture(),
|
|
ProjectFixture({
|
|
id: '23',
|
|
slug: 'my-proj',
|
|
name: 'My Proj',
|
|
}),
|
|
];
|
|
render(
|
|
<SentryProjectSelectorField onChange={mock} name="project" projects={projects} />
|
|
);
|
|
|
|
await selectEvent.select(screen.getByText(/choose sentry project/i), 'my-proj');
|
|
|
|
expect(mock).toHaveBeenCalledWith('23', expect.anything());
|
|
});
|
|
});
|