Skip to content

Commit 3dfaea0

Browse files
committed
Fix test assertions
1 parent 7dcd017 commit 3dfaea0

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

packages/clerk-js/src/ui/components/OrganizationProfile/__tests__/InviteMembersPage.test.tsx

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ describe('InviteMembersPage', () => {
245245
await waitFor(() => expect(getByRole('button', { name: /select role/i })).toBeInTheDocument());
246246
});
247247

248-
it('enables selecting other options if default role is not available', async () => {
248+
it.only('enables selecting other options if default role is not available', async () => {
249249
const { wrapper, fixtures } = await createFixtures(f => {
250250
f.withOrganizations();
251251
f.withOrganizationDomains(undefined, 'mydefaultrole');
@@ -285,7 +285,7 @@ describe('InviteMembersPage', () => {
285285
});
286286

287287
fixtures.clerk.organization?.inviteMembers.mockResolvedValueOnce([{}] as OrganizationInvitationResource[]);
288-
const { getByRole, userEvent, getByTestId } = render(
288+
const { findByText, getByRole, userEvent, getByTestId } = render(
289289
<Action.Root>
290290
<InviteMembersScreen />
291291
</Action.Root>,
@@ -294,7 +294,7 @@ describe('InviteMembersPage', () => {
294294
await userEvent.type(getByTestId('tag-input'), '[email protected],');
295295
await waitFor(() => expect(getByRole('button', { name: /select role/i })).toBeInTheDocument());
296296
await userEvent.click(getByRole('button', { name: /select role/i }));
297-
await userEvent.click(getByRole('button', { name: /admin/i }));
297+
await userEvent.click(await findByText(/admin/i));
298298
await waitFor(() => expect(getByRole('button', { name: 'Send invitations' })).not.toBeDisabled());
299299
});
300300

@@ -357,11 +357,10 @@ describe('InviteMembersPage', () => {
357357
{ wrapper },
358358
);
359359

360+
expect(getByRole('button', { name: 'Send invitations' })).toBeDisabled();
360361
await userEvent.type(getByTestId('tag-input'), '[email protected],');
361-
await waitFor(() => expect(getByRole('button', { name: /select role/i })).toBeInTheDocument());
362-
await userEvent.click(getByRole('button', { name: /select role/i }));
363-
await userEvent.click(getByRole('button', { name: /admin/i }));
364-
await waitFor(() => expect(getByRole('button', { name: 'Send invitations' })).not.toBeDisabled());
362+
expect(getByRole('button', { name: 'Send invitations' })).not.toBeDisabled();
363+
await userEvent.click(getByRole('button', { name: /mydefaultrole/i }));
365364
});
366365
});
367366

0 commit comments

Comments
 (0)