Skip to content

Commit a574389

Browse files
committed
Add changeset
1 parent c5eee57 commit a574389

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

.changeset/fuzzy-hotels-decide.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@clerk/clerk-js': patch
3+
---
4+
5+
Fix "You must belong to an organization" screen showing when user has existing memberships, invitations or suggestions

packages/clerk-js/src/ui/components/SessionTasks/tasks/TaskChooseOrganization/__tests__/TaskChooseOrganization.test.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@ import { describe, expect, it } from 'vitest';
33

44
import { bindCreateFixtures } from '@/test/create-fixtures';
55
import { render } from '@/test/utils';
6-
import { createFakeUserOrganizationMembership } from '@/ui/components/OrganizationSwitcher/__tests__/test-utils';
6+
import {
7+
createFakeUserOrganizationMembership,
8+
createFakeUserOrganizationSuggestion,
9+
} from '@/ui/components/OrganizationSwitcher/__tests__/test-utils';
710

811
import { TaskChooseOrganization } from '..';
912

@@ -265,6 +268,7 @@ describe('TaskChooseOrganization', () => {
265268
f.withForceOrganizationSelection();
266269
f.withUser({
267270
create_organization_enabled: false,
271+
tasks: [{ key: 'choose-organization' }],
268272
});
269273
});
270274

@@ -303,10 +307,10 @@ describe('TaskChooseOrganization', () => {
303307
}),
304308
);
305309

306-
const { findByText, queryByRole } = render(<TaskChooseOrganization />, { wrapper });
310+
const { findByText, queryByText, queryByRole } = render(<TaskChooseOrganization />, { wrapper });
307311

308312
expect(await findByText('Existing Org')).toBeInTheDocument();
309-
expect(await findByText('Create new organization')).toBeInTheDocument();
313+
expect(await queryByText('Create new organization')).not.toBeInTheDocument();
310314
expect(queryByRole('textbox', { name: /name/i })).not.toBeInTheDocument();
311315
});
312316
});

0 commit comments

Comments
 (0)