Merge pull request #19528 from overleaf/dp-equation-preview

Equation Preview

GitOrigin-RevId: 98e71e5d2c1a83d6c9fa685eeee1f4b93a5a3da1
This commit is contained in:
David
2024-07-25 08:05:04 +00:00
committed by Copybot
parent a8a655ff3b
commit c07d2f3fa2
22 changed files with 346 additions and 64 deletions
@@ -0,0 +1,23 @@
import { screen, within } from '@testing-library/dom'
import { expect } from 'chai'
import fetchMock from 'fetch-mock'
import SettingsMathPreview from '@/features/editor-left-menu/components/settings/settings-math-preview'
import { renderWithEditorContext } from '../../../../helpers/render-with-context'
describe('<SettingsMathPreview />', function () {
afterEach(function () {
fetchMock.reset()
})
it('shows correct menu', async function () {
renderWithEditorContext(<SettingsMathPreview />)
const select = screen.getByLabelText('Equation preview')
const optionOn = within(select).getByText('On')
expect(optionOn.getAttribute('value')).to.equal('true')
const optionOff = within(select).getByText('Off')
expect(optionOff.getAttribute('value')).to.equal('false')
})
})
@@ -54,6 +54,7 @@ const defaultUserSettings = {
autoPairDelimiters: true,
trackChanges: true,
syntaxValidation: false,
mathPreview: true,
}
export function EditorProviders({