Files
overleaf-cep/services/web/test/frontend/features/source-editor/helpers/mock-scope.ts
T
Tim Down e11724799f Move project context out of scope value store (#26615)
* Refactor project context to not use scope store

* Fix Cypress tests for project context changes

* Fix frontend React Testing Library tests for project context changes

* Remove redundant code

* Fix some project types in tests

* Remove unused import and fix a type

* Throw an error if updating the project in the project context before joining the project

* Fix some review panel tests

* Remove unused imports

GitOrigin-RevId: 2f0c928b651f387aa980c29aef7d1ba0649790a7
2025-07-10 08:06:31 +00:00

35 lines
909 B
TypeScript

import { docId, mockDoc } from './mock-doc'
import { sleep } from '../../../helpers/sleep'
export const rootFolderId = '012345678901234567890123'
export const mockScope = (
content?: string,
{ docOptions = {}, permissions = {} }: any = {}
) => {
return {
editor: {
sharejs_doc: mockDoc(content, docOptions),
openDocName: 'test.tex',
currentDocumentId: docId,
wantTrackChanges: false,
},
pdf: {
logEntryAnnotations: {},
},
permissions: {
comment: true,
trackedWrite: true,
write: true,
...permissions,
},
toggleReviewPanel: cy.stub(),
toggleTrackChangesForEveryone: cy.stub(),
refreshResolvedCommentsDropdown: cy.stub(() => sleep(1000)),
onlineUserCursorHighlights: {},
permissionsLevel: 'owner',
$on: cy.stub().log(false),
$broadcast: cy.stub().log(false),
$emit: cy.stub().log(false),
}
}