mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Merge pull request #4114 from overleaf/ae-fix-share-modal-test
Fix share modal test by ensuring that scoped value is used GitOrigin-RevId: 618dd15bf1b21403cc9a64d3174707ee713bda86
This commit is contained in:
parent
9e56924580
commit
cc6629693e
1 changed files with 9 additions and 3 deletions
|
@ -10,6 +10,7 @@ import {
|
|||
waitForElementToBeRemoved,
|
||||
} from '@testing-library/react'
|
||||
import fetchMock from 'fetch-mock'
|
||||
import { get } from 'lodash'
|
||||
import ShareProjectModal from '../../../../../frontend/js/features/share-project-modal/components/share-project-modal'
|
||||
import * as locationModule from '../../../../../frontend/js/features/share-project-modal/utils/location'
|
||||
|
||||
|
@ -70,11 +71,16 @@ describe('<ShareProjectModal/>', function () {
|
|||
]
|
||||
|
||||
const ideWithProject = project => {
|
||||
const scope = { project }
|
||||
|
||||
return {
|
||||
$scope: {
|
||||
$watch: () => () => {},
|
||||
$watch: (path, callback) => {
|
||||
callback(get(scope, path))
|
||||
return () => null
|
||||
},
|
||||
$applyAsync: () => {},
|
||||
project,
|
||||
...scope,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
@ -243,7 +249,7 @@ describe('<ShareProjectModal/>', function () {
|
|||
)
|
||||
|
||||
await screen.findByText(
|
||||
'To change access permissions, please ask the project owner'
|
||||
'To add more collaborators or turn on link sharing, please ask the project owner'
|
||||
)
|
||||
|
||||
expect(screen.queryByRole('button', { name: 'Turn off link sharing' })).to
|
||||
|
|
Loading…
Reference in a new issue