mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 06:03:45 +01:00
[web] Consolidate ide settings in `features/ide-settings` GitOrigin-RevId: cbf0ff069399f418d8cb0d8165628df190046ea9
36 lines
1.2 KiB
TypeScript
36 lines
1.2 KiB
TypeScript
import { fireEvent, screen, within, render } from '@testing-library/react'
|
|
import { expect } from 'chai'
|
|
import { SettingsModalProvider } from '@/features/ide-settings/context/settings-modal-context'
|
|
import { EditorProviders } from '../../../helpers/editor-providers'
|
|
import DictionarySetting from '@/features/ide-settings/components/editor-settings/dictionary-setting'
|
|
import RailModals from '@/features/ide-react/components/rail/rail-modals'
|
|
|
|
describe('<DictionarySetting />', function () {
|
|
it('open dictionary modal', function () {
|
|
render(
|
|
<EditorProviders>
|
|
<SettingsModalProvider>
|
|
<DictionarySetting />
|
|
<RailModals />
|
|
</SettingsModalProvider>
|
|
</EditorProviders>
|
|
)
|
|
|
|
screen.getByText('Dictionary')
|
|
|
|
const button = screen.getByText('Edit')
|
|
fireEvent.click(button)
|
|
|
|
const modal = screen.getByTestId('dictionary-modal')
|
|
|
|
within(modal).getByRole('heading', { name: 'Edit Dictionary' })
|
|
within(modal).getByText('Your custom dictionary is empty.')
|
|
|
|
const closeButton = within(modal).getByRole('button', {
|
|
name: 'Close dialog',
|
|
})
|
|
fireEvent.click(closeButton)
|
|
expect(screen.getByTestId('dictionary-modal')).to.not.be.null
|
|
})
|
|
})
|