diff --git a/services/web/frontend/js/features/share-project-modal/components/project-access.tsx b/services/web/frontend/js/features/share-project-modal/components/project-access.tsx index 4287fafe7e..7ea3f95ee3 100644 --- a/services/web/frontend/js/features/share-project-modal/components/project-access.tsx +++ b/services/web/frontend/js/features/share-project-modal/components/project-access.tsx @@ -216,7 +216,7 @@ function ProjectAccess({
- {invitedPeopleCount > 1 + {invitedPeopleCount > 0 ? t('x_people_invited', { count: invitedPeopleCount }) : t('no_one_invited_yet')}
diff --git a/services/web/frontend/js/features/share-project-modal/components/share-modal-body.tsx b/services/web/frontend/js/features/share-project-modal/components/share-modal-body.tsx index 344e49ba98..c435405dcd 100644 --- a/services/web/frontend/js/features/share-project-modal/components/share-modal-body.tsx +++ b/services/web/frontend/js/features/share-project-modal/components/share-modal-body.tsx @@ -145,10 +145,7 @@ export default function ShareModalBody({ ) : ( )} diff --git a/services/web/test/frontend/features/share-project-modal/components/share-project-modal.test.tsx b/services/web/test/frontend/features/share-project-modal/components/share-project-modal.test.tsx index 6e01310e43..3d695dfcea 100644 --- a/services/web/test/frontend/features/share-project-modal/components/share-project-modal.test.tsx +++ b/services/web/test/frontend/features/share-project-modal/components/share-project-modal.test.tsx @@ -1128,7 +1128,7 @@ describe('', function () { expect(screen.queryByText('1 person invited')).to.be.null }) - it('shows the invited people count, including the owner, when there are collaborators', async function () { + it('shows the invited people count, excluding the owner, when there are collaborators', async function () { const members: ProjectMember[] = [ { _id: 'member-author' as UserId, @@ -1151,7 +1151,27 @@ describe('', function () { createContextProps({ publicAccessLevel: 'private', members }) ) - await screen.findByText('3 people invited') + await screen.findByText('2 people invited') + expect(screen.queryByText('No one invited yet')).to.be.null + }) + + it('shows "1 person invited" when there is a single collaborator', async function () { + const members: ProjectMember[] = [ + { + _id: 'member-author' as UserId, + email: 'member-author@example.com', + privileges: 'readAndWrite', + first_name: 'Member', + last_name: 'Author', + }, + ] + + renderWithEditorContext( + , + createContextProps({ publicAccessLevel: 'private', members }) + ) + + await screen.findByText('1 person invited') expect(screen.queryByText('No one invited yet')).to.be.null }) })