settings-compiler.test.tsx 1.1 KB

1234567891011121314151617181920212223242526272829
  1. import { screen, within } from '@testing-library/dom'
  2. import { expect } from 'chai'
  3. import fetchMock from 'fetch-mock'
  4. import SettingsCompiler from '../../../../../../frontend/js/features/editor-left-menu/components/settings/settings-compiler'
  5. import { renderWithEditorContext } from '../../../../helpers/render-with-context'
  6. describe('<SettingsCompiler />', function () {
  7. afterEach(function () {
  8. fetchMock.reset()
  9. })
  10. it('shows correct menu', async function () {
  11. renderWithEditorContext(<SettingsCompiler />)
  12. const select = screen.getByLabelText('Compiler')
  13. const optionPdfLaTeX = within(select).getByText('pdfLaTeX')
  14. expect(optionPdfLaTeX.getAttribute('value')).to.equal('pdflatex')
  15. const optionLaTeX = within(select).getByText('LaTeX')
  16. expect(optionLaTeX.getAttribute('value')).to.equal('latex')
  17. const optionXeLaTeX = within(select).getByText('XeLaTeX')
  18. expect(optionXeLaTeX.getAttribute('value')).to.equal('xelatex')
  19. const optionLuaLaTeX = within(select).getByText('LuaLaTeX')
  20. expect(optionLuaLaTeX.getAttribute('value')).to.equal('lualatex')
  21. })
  22. })