From a570d36dc28d353cb10ca2529116f31b7bc21ca3 Mon Sep 17 00:00:00 2001 From: Igor Brasileiro Date: Fri, 17 Sep 2021 16:23:02 -0300 Subject: [PATCH] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: LarĂ­cia Mota --- packages/store-ui/src/molecules/Modal/Modal.test.tsx | 4 ++-- packages/store-ui/src/molecules/Modal/Modal.tsx | 2 +- packages/store-ui/src/molecules/Modal/useTrapFocus.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/store-ui/src/molecules/Modal/Modal.test.tsx b/packages/store-ui/src/molecules/Modal/Modal.test.tsx index d6b79039d2..6b7150d66f 100644 --- a/packages/store-ui/src/molecules/Modal/Modal.test.tsx +++ b/packages/store-ui/src/molecules/Modal/Modal.test.tsx @@ -31,7 +31,7 @@ const TestModal = () => { } describe('Modal', () => { - it('Test data-store-modal', () => { + it('The attribute data-store-modal should be present', () => { const { getByTestId } = render( Foo @@ -117,7 +117,7 @@ describe('Modal', () => { fireEvent.click(getByTestId('trigger')) - // Press any key different from 'Escape' won't close the modal + // Pressing any key other than 'Escape' won't close the modal fireEvent.keyPress(getByTestId('store-modal'), { key: 'j' }) expect(getByTestId('store-modal')).toBeInTheDocument() diff --git a/packages/store-ui/src/molecules/Modal/Modal.tsx b/packages/store-ui/src/molecules/Modal/Modal.tsx index ff1e03f4ee..5169ad2a16 100644 --- a/packages/store-ui/src/molecules/Modal/Modal.tsx +++ b/packages/store-ui/src/molecules/Modal/Modal.tsx @@ -49,7 +49,7 @@ const ModalContent = ({ children, ...props }: ModalContentProps) => { {/* * This next line is disabled due to the onClick prop. * Even though div isn't clickable, the onClick is required to prevent the event bubbles - * until the overlay that calls onDismiss inside the onClick handler. + * until the overlay, which calls onDismiss inside the onClick handler, is clicked. */} {/* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/click-events-have-key-events */}