settings-line-height.test.tsx 976 B

1234567891011121314151617181920212223242526
  1. import { screen, within } from '@testing-library/dom'
  2. import { expect } from 'chai'
  3. import fetchMock from 'fetch-mock'
  4. import SettingsLineHeight from '../../../../../../frontend/js/features/editor-left-menu/components/settings/settings-line-height'
  5. import { renderWithEditorContext } from '../../../../helpers/render-with-context'
  6. describe('<SettingsLineHeight />', function () {
  7. afterEach(function () {
  8. fetchMock.reset()
  9. })
  10. it('shows correct menu', async function () {
  11. renderWithEditorContext(<SettingsLineHeight />)
  12. const select = screen.getByLabelText('Line Height')
  13. const optionCompact = within(select).getByText('Compact')
  14. expect(optionCompact.getAttribute('value')).to.equal('compact')
  15. const optionNormal = within(select).getByText('Normal')
  16. expect(optionNormal.getAttribute('value')).to.equal('normal')
  17. const optionWide = within(select).getByText('Wide')
  18. expect(optionWide.getAttribute('value')).to.equal('wide')
  19. })
  20. })