Skip to content

Commit

Permalink
test(ui): Add test for GH-69143
Browse files Browse the repository at this point in the history
  • Loading branch information
evanpurkhiser committed Apr 18, 2024
1 parent e849a2a commit 46be31a
Showing 1 changed file with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,27 @@ describe('SentryMemberTeamSelectorField', () => {
expect(mock).toHaveBeenCalledWith(null, expect.anything());
});

it('separates my teams and other teams', async () => {
TeamStore.init();
TeamStore.loadInitialData([
TeamFixture(),
TeamFixture({id: '2', slug: 'other-team', isMember: false}),
]);

const mock = jest.fn();
render(
<SentryMemberTeamSelectorField
label="Select Owner"
onChange={mock}
name="team-or-member"
/>
);

await selectEvent.openMenu(screen.getByRole('textbox', {name: 'Select Owner'}));
expect(await screen.findByText('My Teams')).toBeInTheDocument();
expect(await screen.findByText('Other Teams')).toBeInTheDocument();
});

it('can select a member', async () => {
const mock = jest.fn();
render(
Expand Down

0 comments on commit 46be31a

Please sign in to comment.