mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-03 14:19:01 +02:00
f27c99ea4b
* merging ide-redesign/components/file-tree into features/file-tree * moving ide-redesign/contexts/settings-modal-context to features/settings/contexts * use-collapsible-file-tree.tsx → features/file-tree/hooks * use-focus-on-setting.tsx → features/settings/hooks * use-project-notification-preferences.ts → features/settings/hooks * use-rail-overflow.tsx→ features/ide-react/hooks * deleting use-switch-enable-new-editor-state.ts * use-toolbar-menu-editor-commands.tsx → features/source-editor/hooks * npm run extract-translations * modifying the test to target correct buttons and removing a test for old component * adding a test back and modifying it * changing the test GitOrigin-RevId: baa1e9a992c88b84313eea82161354d4958cf1ef
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/settings/context/settings-modal-context'
|
|
import { EditorProviders } from '../../../helpers/editor-providers'
|
|
import DictionarySetting from '@/features/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
|
|
})
|
|
})
|