mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 14:13:43 +01:00
Merge pull request #24225 from overleaf/em-reviewers-share-modal
Count reviewers towards collaborator limit in share modal GitOrigin-RevId: 27ec3a787124be7590791412d914ec6da78bab35
This commit is contained in:
+34
@@ -101,6 +101,7 @@ describe('<ShareProjectModal/>', function () {
|
||||
fetchMock.get('/user/contacts', { contacts })
|
||||
window.metaAttributesCache.set('ol-user', { allowedFreeTrial: true })
|
||||
window.metaAttributesCache.set('ol-showUpgradePrompt', true)
|
||||
window.metaAttributesCache.set('ol-isReviewerRoleEnabled', true)
|
||||
})
|
||||
|
||||
afterEach(function () {
|
||||
@@ -691,6 +692,39 @@ describe('<ShareProjectModal/>', function () {
|
||||
|
||||
await screen.findByText('Add more editors')
|
||||
expect(screen.getByRole('option', { name: 'Can edit' }).disabled).to.be.true
|
||||
expect(screen.getByRole('option', { name: 'Can review' }).disabled).to.be
|
||||
.true
|
||||
expect(screen.getByRole('option', { name: 'Can view' }).disabled).to.be
|
||||
.false
|
||||
|
||||
screen.getByText(
|
||||
/Upgrade to add more editors and access collaboration features like track changes and full project history/
|
||||
)
|
||||
})
|
||||
|
||||
it('counts reviewers towards the collaborator limit', async function () {
|
||||
renderWithEditorContext(<ShareProjectModal {...modalProps} />, {
|
||||
scope: {
|
||||
project: {
|
||||
...project,
|
||||
features: {
|
||||
collaborators: 1,
|
||||
},
|
||||
members: [
|
||||
{
|
||||
_id: 'reviewer-id',
|
||||
email: 'reviewer@example.com',
|
||||
privileges: 'review',
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
await screen.findByText('Add more editors')
|
||||
expect(screen.getByRole('option', { name: 'Can edit' }).disabled).to.be.true
|
||||
expect(screen.getByRole('option', { name: 'Can review' }).disabled).to.be
|
||||
.true
|
||||
expect(screen.getByRole('option', { name: 'Can view' }).disabled).to.be
|
||||
.false
|
||||
|
||||
|
||||
Reference in New Issue
Block a user