From 1c1b48edab5c058999afc092b3b1a3200176368d Mon Sep 17 00:00:00 2001 From: Andrew Rumble Date: Thu, 4 Apr 2024 15:14:09 +0100 Subject: [PATCH] Merge pull request #17707 from overleaf/AR-modal-close-consistency-fixes Modal "Close" button consistency fixes GitOrigin-RevId: 55e5178c9e820fffd220f0010906546f0baa2065 --- .../dictionary/components/dictionary-modal-content.tsx | 2 +- .../js/features/hotkeys-modal/components/hotkeys-modal.jsx | 4 ++-- .../components/word-count-modal-content.jsx | 2 +- .../word-count-modal/components/word-count-modal.jsx | 2 +- .../components/editor-left-menu/editor-left-menu.spec.tsx | 2 +- .../components/settings/settings-dictionary.test.tsx | 6 ++++-- .../hotkeys-modal/components/hotkeys-modal.test.jsx | 2 +- 7 files changed, 11 insertions(+), 9 deletions(-) diff --git a/services/web/frontend/js/features/dictionary/components/dictionary-modal-content.tsx b/services/web/frontend/js/features/dictionary/components/dictionary-modal-content.tsx index 4f86611eff..7543878d23 100644 --- a/services/web/frontend/js/features/dictionary/components/dictionary-modal-content.tsx +++ b/services/web/frontend/js/features/dictionary/components/dictionary-modal-content.tsx @@ -84,7 +84,7 @@ export default function DictionaryModalContent({ diff --git a/services/web/frontend/js/features/hotkeys-modal/components/hotkeys-modal.jsx b/services/web/frontend/js/features/hotkeys-modal/components/hotkeys-modal.jsx index fe20c47703..593094ba70 100644 --- a/services/web/frontend/js/features/hotkeys-modal/components/hotkeys-modal.jsx +++ b/services/web/frontend/js/features/hotkeys-modal/components/hotkeys-modal.jsx @@ -23,7 +23,7 @@ export default function HotkeysModal({ animation={animation} > - {t('hotkeys')} (Source editor) + {t('hotkeys')} @@ -192,7 +192,7 @@ export default function HotkeysModal({ diff --git a/services/web/frontend/js/features/word-count-modal/components/word-count-modal-content.jsx b/services/web/frontend/js/features/word-count-modal/components/word-count-modal-content.jsx index 098d2a6157..ad5f258bff 100644 --- a/services/web/frontend/js/features/word-count-modal/components/word-count-modal-content.jsx +++ b/services/web/frontend/js/features/word-count-modal/components/word-count-modal-content.jsx @@ -77,7 +77,7 @@ export default function WordCountModalContent({ handleHide }) { diff --git a/services/web/frontend/js/features/word-count-modal/components/word-count-modal.jsx b/services/web/frontend/js/features/word-count-modal/components/word-count-modal.jsx index daed9eb7a2..a55c9f15fa 100644 --- a/services/web/frontend/js/features/word-count-modal/components/word-count-modal.jsx +++ b/services/web/frontend/js/features/word-count-modal/components/word-count-modal.jsx @@ -13,7 +13,7 @@ const WordCountModal = React.memo(function WordCountModal({ animation show={show} onHide={handleHide} - id="clone-project-modal" + id="word-count-modal" > diff --git a/services/web/test/frontend/components/editor-left-menu/editor-left-menu.spec.tsx b/services/web/test/frontend/components/editor-left-menu/editor-left-menu.spec.tsx index ced3ad9d5e..9527c7995b 100644 --- a/services/web/test/frontend/components/editor-left-menu/editor-left-menu.spec.tsx +++ b/services/web/test/frontend/components/editor-left-menu/editor-left-menu.spec.tsx @@ -800,7 +800,7 @@ describe('', function () { ) cy.findByRole('button', { name: 'Show Hotkeys' }).click() - cy.findByText('Hotkeys (Source editor)') + cy.findByText('Hotkeys') }) it('shows correct url for documentation', function () { diff --git a/services/web/test/frontend/features/editor-left-menu/components/settings/settings-dictionary.test.tsx b/services/web/test/frontend/features/editor-left-menu/components/settings/settings-dictionary.test.tsx index db2642397a..20859676b5 100644 --- a/services/web/test/frontend/features/editor-left-menu/components/settings/settings-dictionary.test.tsx +++ b/services/web/test/frontend/features/editor-left-menu/components/settings/settings-dictionary.test.tsx @@ -17,8 +17,10 @@ describe('', 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 }) }) diff --git a/services/web/test/frontend/features/hotkeys-modal/components/hotkeys-modal.test.jsx b/services/web/test/frontend/features/hotkeys-modal/components/hotkeys-modal.test.jsx index 615f589a33..8d18f806f0 100644 --- a/services/web/test/frontend/features/hotkeys-modal/components/hotkeys-modal.test.jsx +++ b/services/web/test/frontend/features/hotkeys-modal/components/hotkeys-modal.test.jsx @@ -14,7 +14,7 @@ describe('', function () { const { baseElement } = render() expect(baseElement.querySelector('.modal-title').textContent).to.equal( - 'Hotkeys (Source editor)' + 'Hotkeys' ) })