mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 14:13:43 +01:00
Merge pull request #34537 from overleaf/ii-share-modal-invited-people
Show "No one invited yet" instead of "1 person invited" for solo projects GitOrigin-RevId: 0423b507e0574dc5a381cbe4044912a25af7a3f0
This commit is contained in:
+46
@@ -1069,6 +1069,52 @@ describe('<ShareProjectModal/>', function () {
|
||||
await screen.findByText('Anyone in your group with the link')
|
||||
})
|
||||
|
||||
describe('invited people count', function () {
|
||||
beforeEach(function () {
|
||||
fetchMock.get(
|
||||
`/project/${shareModalProjectDefaults._id}/sharing-link`,
|
||||
404
|
||||
)
|
||||
})
|
||||
|
||||
it('shows "No one invited yet" when the owner is the only person', async function () {
|
||||
renderWithEditorContext(
|
||||
<ShareProjectModal {...modalProps} />,
|
||||
createContextProps({ publicAccessLevel: 'private' })
|
||||
)
|
||||
|
||||
await screen.findByText('No one invited yet')
|
||||
expect(screen.queryByText('1 person invited')).to.be.null
|
||||
})
|
||||
|
||||
it('shows the invited people count, including the owner, when there are collaborators', async function () {
|
||||
const members: ProjectMember[] = [
|
||||
{
|
||||
_id: 'member-author' as UserId,
|
||||
email: 'member-author@example.com',
|
||||
privileges: 'readAndWrite',
|
||||
first_name: 'Member',
|
||||
last_name: 'Author',
|
||||
},
|
||||
{
|
||||
_id: 'member-viewer' as UserId,
|
||||
email: 'member-viewer@example.com',
|
||||
privileges: 'readOnly',
|
||||
first_name: 'Member',
|
||||
last_name: 'Viewer',
|
||||
},
|
||||
]
|
||||
|
||||
renderWithEditorContext(
|
||||
<ShareProjectModal {...modalProps} />,
|
||||
createContextProps({ publicAccessLevel: 'private', members })
|
||||
)
|
||||
|
||||
await screen.findByText('3 people invited')
|
||||
expect(screen.queryByText('No one invited yet')).to.be.null
|
||||
})
|
||||
})
|
||||
|
||||
describe('copy link button', function () {
|
||||
let clipboardWriteTextStub: sinon.SinonStub
|
||||
|
||||
|
||||
Reference in New Issue
Block a user