editor-left-menu.spec.tsx 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855
  1. import EditorLeftMenu from '../../../../frontend/js/features/editor-left-menu/components/editor-left-menu'
  2. import {
  3. AllowedImageName,
  4. MainDocument,
  5. OverallThemeMeta,
  6. SpellCheckLanguage,
  7. } from '../../../../types/project-settings'
  8. import { EditorProviders } from '../../helpers/editor-providers'
  9. import { mockScope } from './scope'
  10. describe('<EditorLeftMenu />', function () {
  11. beforeEach(function () {
  12. cy.viewport(800, 800)
  13. cy.interceptCompile()
  14. })
  15. // eslint-disable-next-line mocha/no-skipped-tests
  16. describe.skip('for non-anonymous users', function () {
  17. const overallThemes: OverallThemeMeta[] = [
  18. {
  19. name: 'Overall Theme 1',
  20. val: '',
  21. path: 'https://overleaf.com/overalltheme-1.css',
  22. },
  23. {
  24. name: 'Overall Theme 2',
  25. val: 'light-',
  26. path: 'https://overleaf.com/overalltheme-2.css',
  27. },
  28. ]
  29. const allowedImageNames: AllowedImageName[] = [
  30. {
  31. imageDesc: 'Image 1',
  32. imageName: 'img-1',
  33. },
  34. {
  35. imageDesc: 'Image 2',
  36. imageName: 'img-2',
  37. },
  38. ]
  39. beforeEach(function () {
  40. window.metaAttributesCache.set('ol-overallThemes', overallThemes)
  41. window.metaAttributesCache.set('ol-allowedImageNames', allowedImageNames)
  42. window.metaAttributesCache.set('ol-anonymous', false)
  43. window.metaAttributesCache.set('ol-showSupport', true)
  44. window.metaAttributesCache.set('ol-user', {
  45. email: 'sherlock@holmes.co.uk',
  46. first_name: 'Sherlock',
  47. last_name: 'Holmes',
  48. })
  49. })
  50. it('render full menu', function () {
  51. const scope = mockScope({
  52. ui: {
  53. leftMenuShown: true,
  54. },
  55. })
  56. cy.mount(
  57. <EditorProviders scope={scope}>
  58. <EditorLeftMenu />
  59. </EditorProviders>
  60. )
  61. // Download Menu
  62. cy.findByRole('heading', { name: 'Download' })
  63. cy.findByRole('link', { name: 'Source' })
  64. cy.findByRole('link', { name: 'PDF' })
  65. // Actions Menu
  66. cy.findByRole('heading', { name: 'Actions' })
  67. cy.findByRole('button', { name: 'Copy Project' })
  68. cy.findByRole('button', { name: 'Word Count' })
  69. // Sync Menu
  70. cy.findByRole('heading', { name: 'Sync' })
  71. cy.findByRole('button', { name: 'Dropbox' })
  72. cy.findByRole('button', { name: 'Git' })
  73. cy.findByRole('button', { name: 'GitHub' })
  74. // Settings Menu
  75. cy.findByRole('heading', { name: 'Settings' })
  76. cy.findByLabelText('Compiler')
  77. cy.findByLabelText('TeX Live version')
  78. cy.findByLabelText('Main document')
  79. cy.findByLabelText('Spell check')
  80. cy.findByLabelText('Auto-complete')
  81. cy.findByLabelText('Auto-close Brackets')
  82. cy.findByLabelText('Code check')
  83. cy.findByLabelText('Editor theme')
  84. cy.findByLabelText('Overall theme')
  85. cy.findByLabelText('Keybindings')
  86. cy.findByLabelText('Font Size')
  87. cy.findByLabelText('Font Family')
  88. cy.findByLabelText('Line Height')
  89. cy.findByLabelText('PDF Viewer')
  90. // Help Menu
  91. cy.findByRole('heading', { name: 'Help' })
  92. cy.findByRole('button', { name: 'Show Hotkeys' })
  93. cy.findByRole('link', { name: 'Documentation' })
  94. cy.findByRole('button', { name: 'Contact Us' })
  95. })
  96. describe('download menu', function () {
  97. it('have a correct source & pdf download url', function () {
  98. const scope = mockScope({
  99. ui: {
  100. leftMenuShown: true,
  101. },
  102. })
  103. cy.mount(
  104. <EditorProviders scope={scope}>
  105. <EditorLeftMenu />
  106. </EditorProviders>
  107. )
  108. cy.findByRole('link', { name: 'Source' }).should(
  109. 'have.attr',
  110. 'href',
  111. '/project/project123/download/zip'
  112. )
  113. cy.findByRole('link', { name: 'PDF' })
  114. .should('have.attr', 'href')
  115. .and('match', /\/download\/project\/project123\/build/)
  116. })
  117. })
  118. describe('actions menu', function () {
  119. it('shows copy project modal correctly', function () {
  120. cy.intercept('POST', '/project/*/clone', {
  121. body: {
  122. project_id: 'new_project_id',
  123. },
  124. })
  125. const scope = mockScope({
  126. ui: {
  127. leftMenuShown: true,
  128. },
  129. })
  130. cy.mount(
  131. <EditorProviders scope={scope}>
  132. <EditorLeftMenu />
  133. </EditorProviders>
  134. )
  135. cy.findByRole('button', { name: 'Copy Project' }).click()
  136. cy.findByRole('heading', { name: 'Copy Project' })
  137. // try closing & re-opening the modal with different methods
  138. cy.findByRole('button', { name: 'Close' }).click()
  139. cy.findByRole('button', { name: 'Copy Project' }).click()
  140. cy.findByRole('button', { name: 'Cancel' }).click()
  141. cy.findByRole('button', { name: 'Copy Project' }).click()
  142. cy.findByLabelText('New Name').focus()
  143. cy.findByLabelText('New Name').clear()
  144. cy.findByLabelText('New Name').type('Project Renamed')
  145. cy.get('#clone-project-form-name[value="Project Renamed"')
  146. })
  147. it('shows word count modal correctly', function () {
  148. cy.intercept('GET', '/project/*/wordcount*', {
  149. texcount: {
  150. encode: 'ascii',
  151. textWords: 781,
  152. headWords: 66,
  153. outside: 11,
  154. headers: 41,
  155. elements: 2,
  156. mathInline: 6,
  157. mathDisplay: 1,
  158. errors: 0,
  159. },
  160. })
  161. const scope = mockScope({
  162. ui: {
  163. leftMenuShown: true,
  164. },
  165. })
  166. cy.mount(
  167. <EditorProviders scope={scope}>
  168. <EditorLeftMenu />
  169. </EditorProviders>
  170. )
  171. cy.findByRole('button', { name: 'Word Count' }).click()
  172. cy.findByText('Total Words:')
  173. cy.findByText('781')
  174. cy.findByText('Headers:')
  175. cy.findByText('41')
  176. cy.findByText('Math Inline:')
  177. cy.findByText('6')
  178. cy.findByText('Math Display:')
  179. cy.findByText('1')
  180. })
  181. })
  182. describe('sync menu', function () {
  183. it('shows dropbox modal correctly', function () {
  184. cy.intercept('GET', '/dropbox/status', {
  185. registered: true,
  186. })
  187. const scope = mockScope({
  188. ui: {
  189. leftMenuShown: true,
  190. },
  191. project: {
  192. members: [],
  193. owner: {
  194. _id: '123',
  195. },
  196. },
  197. user: {
  198. features: {
  199. dropbox: false,
  200. },
  201. },
  202. })
  203. cy.mount(
  204. <EditorProviders scope={scope}>
  205. <EditorLeftMenu />
  206. </EditorProviders>
  207. )
  208. cy.findByRole('button', { name: 'Dropbox' }).click()
  209. cy.findByText('Dropbox Sync')
  210. })
  211. it('shows git modal correctly', function () {
  212. const scope = mockScope({
  213. ui: {
  214. leftMenuShown: true,
  215. },
  216. })
  217. cy.mount(
  218. <EditorProviders scope={scope}>
  219. <EditorLeftMenu />
  220. </EditorProviders>
  221. )
  222. cy.findByRole('button', { name: 'Git' }).click()
  223. cy.findByText('Clone with Git')
  224. cy.findByText(/your project using the link displayed below/)
  225. })
  226. it('shows github modal correctly', function () {
  227. cy.intercept('GET', '/user/github-sync/status', {
  228. available: false,
  229. enabled: false,
  230. })
  231. cy.intercept('GET', '/project/*/github-sync/status', {
  232. enabled: false,
  233. })
  234. const scope = mockScope({
  235. ui: {
  236. leftMenuShown: true,
  237. },
  238. })
  239. cy.mount(
  240. <EditorProviders scope={scope}>
  241. <EditorLeftMenu />
  242. </EditorProviders>
  243. )
  244. cy.findByRole('button', { name: 'GitHub' }).click()
  245. cy.findByText('GitHub Sync')
  246. cy.findByText('Push to GitHub, pull to Overleaf')
  247. })
  248. })
  249. describe('settings menu', function () {
  250. it('shows compiler menu correctly', function () {
  251. const scope = mockScope({
  252. ui: {
  253. leftMenuShown: true,
  254. },
  255. })
  256. cy.mount(
  257. <EditorProviders scope={scope}>
  258. <EditorLeftMenu />
  259. </EditorProviders>
  260. )
  261. cy.get<HTMLOptionElement>('#settings-menu-compiler option').then(
  262. options => {
  263. const values = [...options].map(o => o.value)
  264. expect(values).to.deep.eq([
  265. 'pdflatex',
  266. 'latex',
  267. 'xelatex',
  268. 'lualatex',
  269. ])
  270. const texts = [...options].map(o => o.text)
  271. expect(texts).to.deep.eq([
  272. 'pdfLaTeX',
  273. 'LaTeX',
  274. 'XeLaTeX',
  275. 'LuaLaTeX',
  276. ])
  277. }
  278. )
  279. })
  280. it('shows texlive version menu correctly', function () {
  281. const scope = mockScope({
  282. ui: {
  283. leftMenuShown: true,
  284. },
  285. })
  286. cy.mount(
  287. <EditorProviders scope={scope}>
  288. <EditorLeftMenu />
  289. </EditorProviders>
  290. )
  291. cy.get<HTMLOptionElement>('#settings-menu-imageName option').then(
  292. options => {
  293. const values = [...options].map(o => o.value)
  294. expect(values).to.deep.eq(['img-1', 'img-2'])
  295. const texts = [...options].map(o => o.text)
  296. expect(texts).to.deep.eq(['Image 1', 'Image 2'])
  297. }
  298. )
  299. })
  300. it('shows document menu correctly', function () {
  301. const docs: MainDocument[] = [
  302. {
  303. path: 'main.tex',
  304. doc: {
  305. name: 'main.tex',
  306. id: 'id1',
  307. type: 'doc',
  308. selected: false,
  309. } as MainDocument['doc'],
  310. },
  311. {
  312. path: 'main2.tex',
  313. doc: {
  314. name: 'main2.tex',
  315. id: 'id2',
  316. type: 'doc',
  317. selected: false,
  318. } as MainDocument['doc'],
  319. },
  320. ]
  321. const scope = mockScope({
  322. ui: {
  323. leftMenuShown: true,
  324. },
  325. docs,
  326. })
  327. cy.mount(
  328. <EditorProviders scope={scope}>
  329. <EditorLeftMenu />
  330. </EditorProviders>
  331. )
  332. cy.get<HTMLOptionElement>('#settings-menu-rootDocId option').then(
  333. options => {
  334. const values = [...options].map(o => o.value)
  335. expect(values).to.deep.eq(['id1', 'id2'])
  336. const texts = [...options].map(o => o.text)
  337. expect(texts).to.deep.eq(['main.tex', 'main2.tex'])
  338. }
  339. )
  340. })
  341. it('shows spellcheck menu correctly', function () {
  342. const languages: SpellCheckLanguage[] = [
  343. {
  344. name: 'Lang 1',
  345. code: 'lang-1',
  346. },
  347. {
  348. name: 'Lang 2',
  349. code: 'lang-2',
  350. },
  351. ]
  352. window.metaAttributesCache.set('ol-languages', languages)
  353. const scope = mockScope({
  354. ui: {
  355. leftMenuShown: true,
  356. },
  357. })
  358. cy.mount(
  359. <EditorProviders scope={scope}>
  360. <EditorLeftMenu />
  361. </EditorProviders>
  362. )
  363. cy.get<HTMLOptionElement>(
  364. '#settings-menu-spellCheckLanguage option'
  365. ).then(options => {
  366. const values = [...options].map(o => o.value)
  367. expect(values).to.deep.eq(['', 'lang-1', 'lang-2'])
  368. const texts = [...options].map(o => o.text)
  369. expect(texts).to.deep.eq(['Off', 'Lang 1', 'Lang 2'])
  370. })
  371. })
  372. it('shows dictionary modal correctly', function () {
  373. const scope = mockScope({
  374. ui: {
  375. leftMenuShown: true,
  376. },
  377. })
  378. cy.mount(
  379. <EditorProviders scope={scope}>
  380. <EditorLeftMenu />
  381. </EditorProviders>
  382. )
  383. cy.get('label[for="dictionary"] ~ button').click()
  384. cy.findByText('Edit Dictionary')
  385. cy.findByText('Your custom dictionary is empty.')
  386. })
  387. it('shows auto-complete menu correctly', function () {
  388. const scope = mockScope({
  389. ui: {
  390. leftMenuShown: true,
  391. },
  392. })
  393. cy.mount(
  394. <EditorProviders scope={scope}>
  395. <EditorLeftMenu />
  396. </EditorProviders>
  397. )
  398. cy.get<HTMLOptionElement>('#settings-menu-autoComplete option').then(
  399. options => {
  400. const values = [...options].map(o => o.value)
  401. expect(values).to.deep.eq(['true', 'false'])
  402. const texts = [...options].map(o => o.text)
  403. expect(texts).to.deep.eq(['On', 'Off'])
  404. }
  405. )
  406. })
  407. it('shows auto-close brackets menu correctly', function () {
  408. const scope = mockScope({
  409. ui: {
  410. leftMenuShown: true,
  411. },
  412. })
  413. cy.mount(
  414. <EditorProviders scope={scope}>
  415. <EditorLeftMenu />
  416. </EditorProviders>
  417. )
  418. cy.get<HTMLOptionElement>(
  419. '#settings-menu-autoPairDelimiters option'
  420. ).then(options => {
  421. const values = [...options].map(o => o.value)
  422. expect(values).to.deep.eq(['true', 'false'])
  423. const texts = [...options].map(o => o.text)
  424. expect(texts).to.deep.eq(['On', 'Off'])
  425. })
  426. })
  427. it('shows code check menu correctly', function () {
  428. const scope = mockScope({
  429. ui: {
  430. leftMenuShown: true,
  431. },
  432. })
  433. cy.mount(
  434. <EditorProviders scope={scope}>
  435. <EditorLeftMenu />
  436. </EditorProviders>
  437. )
  438. cy.get<HTMLOptionElement>(
  439. '#settings-menu-syntaxValidation option'
  440. ).then(options => {
  441. const values = [...options].map(o => o.value)
  442. expect(values).to.deep.eq(['true', 'false'])
  443. const texts = [...options].map(o => o.text)
  444. expect(texts).to.deep.eq(['On', 'Off'])
  445. })
  446. })
  447. it('shows editor theme menu correctly', function () {
  448. const editorThemes = ['editortheme-1', 'editortheme-2', 'editortheme-3']
  449. const legacyEditorThemes = [
  450. 'legacytheme-1',
  451. 'legacytheme-2',
  452. 'legacytheme-3',
  453. ]
  454. window.metaAttributesCache.set('ol-editorThemes', editorThemes)
  455. window.metaAttributesCache.set(
  456. 'ol-legacyEditorThemes',
  457. legacyEditorThemes
  458. )
  459. const scope = mockScope({
  460. ui: {
  461. leftMenuShown: true,
  462. },
  463. })
  464. cy.mount(
  465. <EditorProviders scope={scope}>
  466. <EditorLeftMenu />
  467. </EditorProviders>
  468. )
  469. cy.get<HTMLOptionElement>('#settings-menu-editorTheme option').then(
  470. options => {
  471. const values = [...options].map(o => o.value)
  472. expect(values).to.deep.eq([
  473. 'editortheme-1',
  474. 'editortheme-2',
  475. 'editortheme-3',
  476. '-',
  477. 'legacytheme-1',
  478. 'legacytheme-2',
  479. 'legacytheme-3',
  480. ])
  481. const texts = [...options].map(o => o.text)
  482. expect(texts).to.deep.eq([
  483. 'editortheme-1',
  484. 'editortheme-2',
  485. 'editortheme-3',
  486. '—————————————————',
  487. 'legacytheme-1',
  488. 'legacytheme-2',
  489. 'legacytheme-3',
  490. ])
  491. }
  492. )
  493. })
  494. it('shows overall theme menu correctly', function () {
  495. const scope = mockScope({
  496. ui: {
  497. leftMenuShown: true,
  498. },
  499. })
  500. cy.mount(
  501. <EditorProviders scope={scope}>
  502. <EditorLeftMenu />
  503. </EditorProviders>
  504. )
  505. cy.get<HTMLOptionElement>('#settings-menu-overallTheme option').then(
  506. options => {
  507. const values = [...options].map(o => o.value)
  508. expect(values).to.deep.eq(['', 'light-'])
  509. const texts = [...options].map(o => o.text)
  510. expect(texts).to.deep.eq(['Overall Theme 1', 'Overall Theme 2'])
  511. }
  512. )
  513. })
  514. it('shows keybindings menu correctly', function () {
  515. const scope = mockScope({
  516. ui: {
  517. leftMenuShown: true,
  518. },
  519. })
  520. cy.mount(
  521. <EditorProviders scope={scope}>
  522. <EditorLeftMenu />
  523. </EditorProviders>
  524. )
  525. cy.get<HTMLOptionElement>('#settings-menu-mode option').then(
  526. options => {
  527. const values = [...options].map(o => o.value)
  528. expect(values).to.deep.eq(['default', 'vim', 'emacs'])
  529. const texts = [...options].map(o => o.text)
  530. expect(texts).to.deep.eq(['None', 'Vim', 'Emacs'])
  531. }
  532. )
  533. })
  534. it('shows font size menu correctly', function () {
  535. const scope = mockScope({
  536. ui: {
  537. leftMenuShown: true,
  538. },
  539. })
  540. cy.mount(
  541. <EditorProviders scope={scope}>
  542. <EditorLeftMenu />
  543. </EditorProviders>
  544. )
  545. cy.get<HTMLOptionElement>('#settings-menu-fontSize option').then(
  546. options => {
  547. const values = [...options].map(o => o.value)
  548. expect(values).to.deep.eq([
  549. '10',
  550. '11',
  551. '12',
  552. '13',
  553. '14',
  554. '16',
  555. '18',
  556. '20',
  557. '22',
  558. '24',
  559. ])
  560. const texts = [...options].map(o => o.text)
  561. expect(texts).to.deep.eq([
  562. '10px',
  563. '11px',
  564. '12px',
  565. '13px',
  566. '14px',
  567. '16px',
  568. '18px',
  569. '20px',
  570. '22px',
  571. '24px',
  572. ])
  573. }
  574. )
  575. })
  576. it('shows font family menu correctly', function () {
  577. const scope = mockScope({
  578. ui: {
  579. leftMenuShown: true,
  580. },
  581. })
  582. cy.mount(
  583. <EditorProviders scope={scope}>
  584. <EditorLeftMenu />
  585. </EditorProviders>
  586. )
  587. cy.get<HTMLOptionElement>('#settings-menu-fontFamily option').then(
  588. options => {
  589. const values = [...options].map(o => o.value)
  590. expect(values).to.deep.eq(['monaco', 'lucida'])
  591. const texts = [...options].map(o => o.text)
  592. expect(texts).to.deep.eq([
  593. 'Monaco / Menlo / Consolas',
  594. 'Lucida / Source Code Pro',
  595. ])
  596. }
  597. )
  598. })
  599. it('shows line height menu correctly', function () {
  600. const scope = mockScope({
  601. ui: {
  602. leftMenuShown: true,
  603. },
  604. })
  605. cy.mount(
  606. <EditorProviders scope={scope}>
  607. <EditorLeftMenu />
  608. </EditorProviders>
  609. )
  610. cy.get<HTMLOptionElement>('#settings-menu-lineHeight option').then(
  611. options => {
  612. const values = [...options].map(o => o.value)
  613. expect(values).to.deep.eq(['compact', 'normal', 'wide'])
  614. const texts = [...options].map(o => o.text)
  615. expect(texts).to.deep.eq(['Compact', 'Normal', 'Wide'])
  616. }
  617. )
  618. })
  619. it('shows pdf viewer menu correctly', function () {
  620. const scope = mockScope({
  621. ui: {
  622. leftMenuShown: true,
  623. },
  624. })
  625. cy.mount(
  626. <EditorProviders scope={scope}>
  627. <EditorLeftMenu />
  628. </EditorProviders>
  629. )
  630. cy.get<HTMLOptionElement>('#settings-menu-pdfViewer option').then(
  631. options => {
  632. const values = [...options].map(o => o.value)
  633. expect(values).to.deep.eq(['pdfjs', 'native'])
  634. const texts = [...options].map(o => o.text)
  635. expect(texts).to.deep.eq(['Overleaf', 'Browser'])
  636. }
  637. )
  638. })
  639. })
  640. describe('help menu', function () {
  641. it('shows hotkeys modal correctly', function () {
  642. const scope = mockScope({
  643. ui: {
  644. leftMenuShown: true,
  645. },
  646. })
  647. cy.mount(
  648. <EditorProviders scope={scope}>
  649. <EditorLeftMenu />
  650. </EditorProviders>
  651. )
  652. cy.findByRole('button', { name: 'Show Hotkeys' }).click()
  653. cy.findByText('Hotkeys (Source editor)')
  654. })
  655. it('shows correct url for documentation', function () {
  656. const scope = mockScope({
  657. ui: {
  658. leftMenuShown: true,
  659. },
  660. })
  661. cy.mount(
  662. <EditorProviders scope={scope}>
  663. <EditorLeftMenu />
  664. </EditorProviders>
  665. )
  666. cy.findByRole('link', { name: 'Documentation' }).should(
  667. 'have.attr',
  668. 'href',
  669. '/learn'
  670. )
  671. })
  672. it('shows correct contact us modal', function () {
  673. const scope = mockScope({
  674. ui: {
  675. leftMenuShown: true,
  676. },
  677. })
  678. cy.mount(
  679. <EditorProviders scope={scope}>
  680. <EditorLeftMenu />
  681. </EditorProviders>
  682. )
  683. cy.findByRole('button', { name: 'Contact Us' }).click()
  684. cy.findByText('Affected project URL (Optional)')
  685. })
  686. })
  687. })
  688. describe('for anonymous users', function () {
  689. it('render minimal menu', function () {
  690. const scope = mockScope({
  691. ui: {
  692. leftMenuShown: true,
  693. },
  694. })
  695. window.metaAttributesCache.set('ol-anonymous', true)
  696. cy.mount(
  697. <EditorProviders scope={scope}>
  698. <EditorLeftMenu />
  699. </EditorProviders>
  700. )
  701. // Download Menu
  702. cy.findByRole('heading', { name: 'Download' })
  703. cy.findByRole('link', { name: 'Source' })
  704. cy.findByRole('link', { name: 'PDF' })
  705. // Actions Menu
  706. cy.findByRole('heading', { name: 'Actions' }).should('not.exist')
  707. cy.findByRole('button', { name: 'Copy Project' }).should('not.exist')
  708. cy.findByRole('button', { name: 'Word Count' }).should('not.exist')
  709. // Sync Menu
  710. cy.findByRole('heading', { name: 'Sync' }).should('not.exist')
  711. cy.findByRole('button', { name: 'Dropbox' }).should('not.exist')
  712. cy.findByRole('button', { name: 'Git' }).should('not.exist')
  713. cy.findByRole('button', { name: 'GitHub' }).should('not.exist')
  714. // Settings Menu
  715. cy.findByRole('heading', { name: 'Settings' }).should('not.exist')
  716. cy.findByLabelText('Compiler').should('not.exist')
  717. cy.findByLabelText('TeX Live version').should('not.exist')
  718. cy.findByLabelText('Main document').should('not.exist')
  719. cy.findByLabelText('Spell check').should('not.exist')
  720. cy.findByLabelText('Auto-complete').should('not.exist')
  721. cy.findByLabelText('Auto-close Brackets').should('not.exist')
  722. cy.findByLabelText('Code check').should('not.exist')
  723. cy.findByLabelText('Editor theme').should('not.exist')
  724. cy.findByLabelText('Overall theme').should('not.exist')
  725. cy.findByLabelText('Keybindings').should('not.exist')
  726. cy.findByLabelText('Font Size').should('not.exist')
  727. cy.findByLabelText('Font Family').should('not.exist')
  728. cy.findByLabelText('Line Height').should('not.exist')
  729. cy.findByLabelText('PDF Viewer').should('not.exist')
  730. // Help Menu
  731. cy.findByRole('heading', { name: 'Help' })
  732. cy.findByRole('button', { name: 'Show Hotkeys' })
  733. cy.findByRole('button', { name: 'Documentation' }).should('not.exist')
  734. cy.findByRole('link', { name: 'Contact Us' }).should('not.exist')
  735. })
  736. })
  737. })