settings-keybindings.test.tsx 962 B

1234567891011121314151617181920212223242526
  1. import { screen, within } from '@testing-library/dom'
  2. import { expect } from 'chai'
  3. import fetchMock from 'fetch-mock'
  4. import SettingsKeybindings from '../../../../../../frontend/js/features/editor-left-menu/components/settings/settings-keybindings'
  5. import { renderWithEditorContext } from '../../../../helpers/render-with-context'
  6. describe('<SettingsKeybindings />', function () {
  7. afterEach(function () {
  8. fetchMock.reset()
  9. })
  10. it('shows correct menu', async function () {
  11. renderWithEditorContext(<SettingsKeybindings />)
  12. const select = screen.getByLabelText('Keybindings')
  13. const optionNone = within(select).getByText('None')
  14. expect(optionNone.getAttribute('value')).to.equal('default')
  15. const optionVim = within(select).getByText('Vim')
  16. expect(optionVim.getAttribute('value')).to.equal('vim')
  17. const optionEmacs = within(select).getByText('Emacs')
  18. expect(optionEmacs.getAttribute('value')).to.equal('emacs')
  19. })
  20. })