mock-scope.ts 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. import { docId, mockDoc } from './mock-doc'
  2. import { Folder } from '../../../../../types/folder'
  3. export const rootFolderId = '012345678901234567890123'
  4. export const figuresFolderId = '123456789012345678901234'
  5. export const figureId = '234567890123456789012345'
  6. export const mockScope = (content?: string) => {
  7. return {
  8. rootFolder: {
  9. id: rootFolderId,
  10. name: 'rootFolder',
  11. selected: false,
  12. children: [
  13. {
  14. id: docId,
  15. name: 'test.tex',
  16. selected: false,
  17. type: 'doc',
  18. },
  19. {
  20. id: figuresFolderId,
  21. name: 'figures',
  22. selected: false,
  23. type: 'folder',
  24. children: [
  25. {
  26. id: figureId,
  27. name: 'frog.jpg',
  28. selected: false,
  29. type: 'file',
  30. },
  31. {
  32. id: 'fake-figure-id',
  33. name: 'unicorn.png',
  34. selected: false,
  35. type: 'file',
  36. },
  37. ],
  38. },
  39. ],
  40. },
  41. settings: {
  42. fontSize: 12,
  43. fontFamily: 'monaco',
  44. lineHeight: 'normal',
  45. editorTheme: 'textmate',
  46. overallTheme: '',
  47. mode: 'default',
  48. autoComplete: true,
  49. autoPairDelimiters: true,
  50. trackChanges: true,
  51. syntaxValidation: false,
  52. },
  53. editor: {
  54. sharejs_doc: mockDoc(content),
  55. open_doc_name: 'test.tex',
  56. open_doc_id: docId,
  57. showVisual: false,
  58. },
  59. pdf: {
  60. logEntryAnnotations: {},
  61. },
  62. project: {
  63. _id: 'test-project',
  64. name: 'Test Project',
  65. spellCheckLanguage: 'en',
  66. rootFolder: [] as Folder[],
  67. },
  68. onlineUserCursorHighlights: {},
  69. permissionsLevel: 'owner',
  70. $on: cy.stub(),
  71. $broadcast: cy.stub(),
  72. $emit: cy.stub(),
  73. $root: {
  74. _references: {
  75. keys: ['foo'],
  76. },
  77. },
  78. }
  79. }