Merge pull request #17707 from overleaf/AR-modal-close-consistency-fixes

Modal "Close" button consistency fixes

GitOrigin-RevId: 55e5178c9e820fffd220f0010906546f0baa2065
This commit is contained in:
Andrew Rumble 2024-04-04 15:14:09 +01:00 committed by Copybot
parent 683ea90f64
commit 1c1b48edab
7 changed files with 11 additions and 9 deletions

View file

@ -84,7 +84,7 @@ export default function DictionaryModalContent({
<Modal.Footer>
<Button bsStyle={null} className="btn-secondary" onClick={handleHide}>
{t('done')}
{t('close')}
</Button>
</Modal.Footer>
</>

View file

@ -23,7 +23,7 @@ export default function HotkeysModal({
animation={animation}
>
<Modal.Header closeButton>
<Modal.Title>{t('hotkeys')} (Source editor)</Modal.Title>
<Modal.Title>{t('hotkeys')}</Modal.Title>
</Modal.Header>
<Modal.Body className="hotkeys-modal">
@ -192,7 +192,7 @@ export default function HotkeysModal({
<Modal.Footer>
<Button bsStyle={null} className="btn-secondary" onClick={handleHide}>
{t('ok')}
{t('close')}
</Button>
</Modal.Footer>
</AccessibleModal>

View file

@ -77,7 +77,7 @@ export default function WordCountModalContent({ handleHide }) {
<Modal.Footer>
<Button bsStyle={null} className="btn-secondary" onClick={handleHide}>
{t('done')}
{t('close')}
</Button>
</Modal.Footer>
</>

View file

@ -13,7 +13,7 @@ const WordCountModal = React.memo(function WordCountModal({
animation
show={show}
onHide={handleHide}
id="clone-project-modal"
id="word-count-modal"
>
<WordCountModalContent handleHide={handleHide} />
</AccessibleModal>

View file

@ -800,7 +800,7 @@ describe('<EditorLeftMenu />', function () {
)
cy.findByRole('button', { name: 'Show Hotkeys' }).click()
cy.findByText('Hotkeys (Source editor)')
cy.findByText('Hotkeys')
})
it('shows correct url for documentation', function () {

View file

@ -17,8 +17,10 @@ describe('<SettingsDictionary />', function () {
within(modal).getByRole('heading', { name: 'Edit Dictionary' })
within(modal).getByText('Your custom dictionary is empty.')
const doneButton = within(modal).getByRole('button', { name: 'Done' })
fireEvent.click(doneButton)
const [, closeButton] = within(modal).getAllByRole('button', {
name: 'Close',
})
fireEvent.click(closeButton)
expect(screen.queryByRole('dialog')).to.be.null
})
})

View file

@ -14,7 +14,7 @@ describe('<HotkeysModal />', function () {
const { baseElement } = render(<HotkeysModal {...modalProps} />)
expect(baseElement.querySelector('.modal-title').textContent).to.equal(
'Hotkeys (Source editor)'
'Hotkeys'
)
})