settings-pdf-viewer.test.tsx 856 B

1234567891011121314151617181920212223
  1. import { screen, within } from '@testing-library/dom'
  2. import { expect } from 'chai'
  3. import fetchMock from 'fetch-mock'
  4. import SettingsPdfViewer from '../../../../../../frontend/js/features/editor-left-menu/components/settings/settings-pdf-viewer'
  5. import { renderWithEditorContext } from '../../../../helpers/render-with-context'
  6. describe('<SettingsPdfViewer />', function () {
  7. afterEach(function () {
  8. fetchMock.reset()
  9. })
  10. it('shows correct menu', async function () {
  11. renderWithEditorContext(<SettingsPdfViewer />)
  12. const select = screen.getByLabelText('PDF Viewer')
  13. const optionOverleaf = within(select).getByText('Overleaf')
  14. expect(optionOverleaf.getAttribute('value')).to.equal('pdfjs')
  15. const optionBrowser = within(select).getByText('Browser')
  16. expect(optionBrowser.getAttribute('value')).to.equal('native')
  17. })
  18. })