mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-02 09:50:44 -05:00
9daa8f5d98
[web] rename all the JSX files to .jsx/.tsx GitOrigin-RevId: 82056ae47e017523722cf258dcc83c8a925a28f7
21 lines
817 B
JavaScript
21 lines
817 B
JavaScript
import { expect } from 'chai'
|
|
import { screen, fireEvent, within } from '@testing-library/react'
|
|
import HelpShowHotkeys from '../../../../../frontend/js/features/editor-left-menu/components/help-show-hotkeys'
|
|
import { renderWithEditorContext } from '../../../helpers/render-with-context'
|
|
import fetchMock from 'fetch-mock'
|
|
|
|
describe('<HelpShowHotkeys />', function () {
|
|
afterEach(function () {
|
|
fetchMock.reset()
|
|
})
|
|
|
|
it('open hotkeys modal when clicked', function () {
|
|
renderWithEditorContext(<HelpShowHotkeys />)
|
|
|
|
expect(screen.queryByRole('dialog')).to.equal(null)
|
|
fireEvent.click(screen.getByRole('button', { name: 'Show Hotkeys' }))
|
|
const modal = screen.getAllByRole('dialog')[0]
|
|
within(modal).getByText('Hotkeys (Legacy source editor)')
|
|
within(modal).getByText('Common')
|
|
})
|
|
})
|