From a7fcd2e842a4910b9cbf1d998ae4aa488203bc75 Mon Sep 17 00:00:00 2001 From: panteliselef Date: Fri, 13 Oct 2023 15:05:43 +0300 Subject: [PATCH] fix(clerk-js): Update to new permission names --- .../__tests__/OrganizationMembers.test.tsx | 6 ++---- .../OrganizationSwitcher/OrganizationSwitcherPopover.tsx | 2 +- .../OrganizationSwitcher/OrganizationSwitcherTrigger.tsx | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/packages/clerk-js/src/ui/components/OrganizationProfile/__tests__/OrganizationMembers.test.tsx b/packages/clerk-js/src/ui/components/OrganizationProfile/__tests__/OrganizationMembers.test.tsx index 6e9d2aaaa5a..3eeb70f6d5b 100644 --- a/packages/clerk-js/src/ui/components/OrganizationProfile/__tests__/OrganizationMembers.test.tsx +++ b/packages/clerk-js/src/ui/components/OrganizationProfile/__tests__/OrganizationMembers.test.tsx @@ -285,10 +285,8 @@ describe('OrganizationMembers', () => { total_count: 2, }), ); - const { queryByText, getByRole } = render(, { wrapper }); - await waitFor(async () => { - await userEvent.click(getByRole('tab', { name: 'Invitations' })); - }); + const { queryByText, findByRole } = render(, { wrapper }); + await userEvent.click(await findByRole('tab', { name: 'Invitations' })); expect(fixtures.clerk.organization?.getInvitations).toHaveBeenCalled(); expect(queryByText('admin1@clerk.dev')).toBeInTheDocument(); expect(queryByText('Admin')).toBeInTheDocument(); diff --git a/packages/clerk-js/src/ui/components/OrganizationSwitcher/OrganizationSwitcherPopover.tsx b/packages/clerk-js/src/ui/components/OrganizationSwitcher/OrganizationSwitcherPopover.tsx index a00b57ce770..f13dd845c9f 100644 --- a/packages/clerk-js/src/ui/components/OrganizationSwitcher/OrganizationSwitcherPopover.tsx +++ b/packages/clerk-js/src/ui/components/OrganizationSwitcher/OrganizationSwitcherPopover.tsx @@ -189,6 +189,6 @@ const NotificationCountBadgeManageButton = withGate( }, { // if the user is not able to accept a request we should not notify them - permission: 'org:memberships:manage', + permission: 'org:sys_memberships:manage', }, ); diff --git a/packages/clerk-js/src/ui/components/OrganizationSwitcher/OrganizationSwitcherTrigger.tsx b/packages/clerk-js/src/ui/components/OrganizationSwitcher/OrganizationSwitcherTrigger.tsx index c5b430cd184..4d7e5f90f45 100644 --- a/packages/clerk-js/src/ui/components/OrganizationSwitcher/OrganizationSwitcherTrigger.tsx +++ b/packages/clerk-js/src/ui/components/OrganizationSwitcher/OrganizationSwitcherTrigger.tsx @@ -98,6 +98,6 @@ const NotificationCountBadgeSwitcherTrigger = withGate( }, { // if the user is not able to accept a request we should not notify them - permission: 'org:memberships:manage', + permission: 'org:sys_memberships:manage', }, );