mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-11 07:00:47 +02:00
e11724799f
* 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
35 lines
909 B
TypeScript
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),
|
|
}
|
|
}
|