From 341001e30a9cef01613ac6c5314482a3b8549730 Mon Sep 17 00:00:00 2001 From: Martin Yosifov Date: Wed, 9 Mar 2022 18:07:28 -0800 Subject: [PATCH] Hide Horizontal Separator from screen readers closes OUT-5016 flag=individual_outcome_rating_and_calculation Test plan: - Enable Improved Outcomes Management FF - Enable Individual Outcome Rating and Calculation FF - Disable Account Level Mastery Scales FF - Go to Account > Outcomes and open devtools -> Elements - Click on Create button and in the Create modal select the horizonal separator between Proficiency Ratings and Calc Method - Verify in the Elements tab that the corresponding
element has aria-hidden="true" attribute - Select an outcome and click on kebab menu -> Edit - In the Edit modal select the horizontal separator between Proficiency Ratings and Calculation Method - Verify in the Elements tab that the corresponding
element has aria-hidden="true" attribute Change-Id: I4c9b13b33900a4ac2892791fa6ff441dedda4c94 Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/286738 Tested-by: Service Cloud Jenkins Reviewed-by: Kyle Rosenbaum QA-Review: Angela Gomba Product-Review: Ben Friedman --- .../outcome_management/react/CreateOutcomeModal.js | 6 +++++- .../react/Management/OutcomeEditModal.js | 8 +++++++- .../Management/__tests__/OutcomeEditModal.test.js | 11 +++++++++++ .../react/__tests__/CreateOutcomeModal.test.js | 8 ++++++++ 4 files changed, 31 insertions(+), 2 deletions(-) diff --git a/ui/features/outcome_management/react/CreateOutcomeModal.js b/ui/features/outcome_management/react/CreateOutcomeModal.js index ba3e38d66c1..e281059fc5e 100644 --- a/ui/features/outcome_management/react/CreateOutcomeModal.js +++ b/ui/features/outcome_management/react/CreateOutcomeModal.js @@ -277,7 +277,11 @@ const CreateOutcomeModal = ({isOpen, onCloseHandler, onSuccess, starterGroupId}) canManage /> -
+ - {attributesEditable.calculationMethod &&
} + {attributesEditable.calculationMethod && ( + + )} { type: 'success' }) }) + + it('displays horizontal divider between ratings and calculation method which is hidden from screen readers', async () => { + const {getByTestId} = renderWithProvider({ + env: { + contextType: 'Account', + contextId: '1', + individualOutcomeRatingAndCalculationFF: true + } + }) + expect(getByTestId('outcome-edit-modal-horizontal-divider')).toBeInTheDocument() + }) }) describe('when feature flag disabled', () => { diff --git a/ui/features/outcome_management/react/__tests__/CreateOutcomeModal.test.js b/ui/features/outcome_management/react/__tests__/CreateOutcomeModal.test.js index 418f80c4237..bfbd9da2697 100644 --- a/ui/features/outcome_management/react/__tests__/CreateOutcomeModal.test.js +++ b/ui/features/outcome_management/react/__tests__/CreateOutcomeModal.test.js @@ -520,6 +520,14 @@ describe('CreateOutcomeModal', () => { }) }) }) + + it('displays horizontal divider between ratings and calculation method which is hidden from screen readers', async () => { + const {getByTestId} = render(, { + individualOutcomeRatingAndCalculationFF: true + }) + await act(async () => jest.runOnlyPendingTimers()) + expect(getByTestId('outcome-create-modal-horizontal-divider')).toBeInTheDocument() + }) }) describe('when feature flag disabled', () => {