2023-06-06 12:42:49 -04:00
|
|
|
import { MainDocument, PdfViewer } from '../../../../types/project-settings'
|
|
|
|
|
|
|
|
type Scope = {
|
|
|
|
settings?: {
|
|
|
|
syntaxValidation?: boolean
|
|
|
|
pdfViewer?: PdfViewer
|
|
|
|
}
|
|
|
|
editor?: {
|
|
|
|
sharejs_doc?: {
|
|
|
|
doc_id?: string
|
|
|
|
getSnapshot?: () => string
|
|
|
|
}
|
|
|
|
}
|
|
|
|
hasLintingError?: boolean
|
|
|
|
ui?: {
|
|
|
|
view?: 'editor' | 'history' | 'file' | 'pdf'
|
|
|
|
pdfLayout?: 'flat' | 'sideBySide' | 'split'
|
|
|
|
leftMenuShown?: boolean
|
|
|
|
}
|
|
|
|
project?: {
|
|
|
|
members?: any[]
|
|
|
|
owner: {
|
|
|
|
_id: string
|
|
|
|
}
|
2023-09-13 05:07:11 -04:00
|
|
|
features?: {
|
|
|
|
gitBridge?: boolean
|
|
|
|
}
|
2023-06-06 12:42:49 -04:00
|
|
|
}
|
|
|
|
user?: {
|
|
|
|
features?: {
|
|
|
|
dropbox: boolean
|
|
|
|
}
|
|
|
|
}
|
|
|
|
docs?: MainDocument[]
|
|
|
|
}
|
|
|
|
|
|
|
|
export const mockScope = (scope?: Scope) => ({
|
|
|
|
settings: {
|
|
|
|
syntaxValidation: false,
|
|
|
|
pdfViewer: 'pdfjs',
|
|
|
|
},
|
|
|
|
editor: {
|
|
|
|
sharejs_doc: {
|
|
|
|
doc_id: 'test-doc',
|
|
|
|
getSnapshot: () => 'some doc content',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
hasLintingError: false,
|
|
|
|
ui: {
|
|
|
|
view: 'editor',
|
|
|
|
pdfLayout: 'sideBySide',
|
|
|
|
leftMenuShown: false,
|
|
|
|
},
|
|
|
|
...scope,
|
|
|
|
})
|