settings-syntax-validation.test.tsx 852 B

1234567891011121314151617181920212223
  1. import { screen, within } from '@testing-library/dom'
  2. import { expect } from 'chai'
  3. import fetchMock from 'fetch-mock'
  4. import SettingsSyntaxValidation from '../../../../../../frontend/js/features/editor-left-menu/components/settings/settings-syntax-validation'
  5. import { renderWithEditorContext } from '../../../../helpers/render-with-context'
  6. describe('<SettingsSyntaxValidation />', function () {
  7. afterEach(function () {
  8. fetchMock.reset()
  9. })
  10. it('shows correct menu', async function () {
  11. renderWithEditorContext(<SettingsSyntaxValidation />)
  12. const select = screen.getByLabelText('Code check')
  13. const optionOn = within(select).getByText('On')
  14. expect(optionOn.getAttribute('value')).to.equal('true')
  15. const optionOff = within(select).getByText('Off')
  16. expect(optionOff.getAttribute('value')).to.equal('false')
  17. })
  18. })