2023-04-13 04:21:25 -04:00
|
|
|
import { docId, mockDoc } from './mock-doc'
|
2023-07-03 04:55:39 -04:00
|
|
|
import { sleep } from '../../../helpers/sleep'
|
2023-10-26 06:01:27 -04:00
|
|
|
import { Folder } from '../../../../../types/folder'
|
2023-06-14 04:29:24 -04:00
|
|
|
|
2023-05-17 03:48:21 -04:00
|
|
|
export const rootFolderId = '012345678901234567890123'
|
|
|
|
export const figuresFolderId = '123456789012345678901234'
|
|
|
|
export const figureId = '234567890123456789012345'
|
2023-04-13 04:21:25 -04:00
|
|
|
export const mockScope = (content?: string) => {
|
|
|
|
return {
|
|
|
|
editor: {
|
|
|
|
sharejs_doc: mockDoc(content),
|
|
|
|
open_doc_name: 'test.tex',
|
|
|
|
open_doc_id: docId,
|
|
|
|
showVisual: false,
|
2023-06-14 04:29:24 -04:00
|
|
|
wantTrackChanges: false,
|
2023-04-13 04:21:25 -04:00
|
|
|
},
|
|
|
|
pdf: {
|
|
|
|
logEntryAnnotations: {},
|
|
|
|
},
|
|
|
|
project: {
|
|
|
|
_id: 'test-project',
|
|
|
|
name: 'Test Project',
|
|
|
|
spellCheckLanguage: 'en',
|
2023-10-26 06:01:27 -04:00
|
|
|
rootFolder: [
|
|
|
|
{
|
|
|
|
_id: rootFolderId,
|
|
|
|
name: 'rootFolder',
|
|
|
|
docs: [
|
|
|
|
{
|
|
|
|
_id: docId,
|
|
|
|
name: 'test.tex',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
folders: [
|
|
|
|
{
|
|
|
|
_id: figuresFolderId,
|
|
|
|
name: 'figures',
|
|
|
|
docs: [],
|
|
|
|
folders: [],
|
|
|
|
fileRefs: [
|
|
|
|
{
|
|
|
|
_id: figureId,
|
|
|
|
name: 'frog.jpg',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
_id: 'fake-figure-id',
|
|
|
|
name: 'unicorn.png',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
fileRefs: [],
|
|
|
|
},
|
|
|
|
] as Folder[],
|
2023-06-14 04:29:24 -04:00
|
|
|
features: {
|
|
|
|
trackChanges: true,
|
|
|
|
},
|
2024-06-05 04:33:11 -04:00
|
|
|
trackChangesState: {},
|
|
|
|
members: [],
|
2023-06-14 04:29:24 -04:00
|
|
|
},
|
|
|
|
permissions: {
|
|
|
|
comment: true,
|
|
|
|
write: true,
|
|
|
|
},
|
|
|
|
reviewPanel: {
|
|
|
|
subView: 'cur_file',
|
|
|
|
formattedProjectMembers: {},
|
|
|
|
fullTCStateCollapsed: true,
|
2023-06-27 08:50:24 -04:00
|
|
|
entries: {},
|
2023-07-03 04:55:39 -04:00
|
|
|
resolvedComments: {},
|
2023-06-14 04:29:24 -04:00
|
|
|
},
|
|
|
|
ui: {
|
|
|
|
reviewPanelOpen: true,
|
2023-04-13 04:21:25 -04:00
|
|
|
},
|
2023-06-15 05:52:54 -04:00
|
|
|
toggleReviewPanel: cy.stub(),
|
|
|
|
toggleTrackChangesForEveryone: cy.stub(),
|
2023-07-03 04:55:39 -04:00
|
|
|
refreshResolvedCommentsDropdown: cy.stub(() => sleep(1000)),
|
2023-04-13 04:21:25 -04:00
|
|
|
onlineUserCursorHighlights: {},
|
|
|
|
permissionsLevel: 'owner',
|
2023-08-04 03:35:17 -04:00
|
|
|
$on: cy.stub().log(false),
|
|
|
|
$broadcast: cy.stub().log(false),
|
|
|
|
$emit: cy.stub().log(false),
|
2023-04-13 04:21:25 -04:00
|
|
|
$root: {
|
|
|
|
_references: {
|
|
|
|
keys: ['foo'],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|