From d59a4bf54db2ed6d515f77ca02f6f81247c73988 Mon Sep 17 00:00:00 2001 From: Dima Alipov Date: Sun, 21 Apr 2024 13:38:35 +0300 Subject: [PATCH] fix: grade value is displayed in the modal --- src/components/GradesView/EditModal/ModalHeaders.jsx | 6 +++--- src/components/GradesView/EditModal/ModalHeaders.test.jsx | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/components/GradesView/EditModal/ModalHeaders.jsx b/src/components/GradesView/EditModal/ModalHeaders.jsx index d9f4ca29..c11a8f2d 100644 --- a/src/components/GradesView/EditModal/ModalHeaders.jsx +++ b/src/components/GradesView/EditModal/ModalHeaders.jsx @@ -22,7 +22,7 @@ export const HistoryKeys = StrictDict({ */ export const ModalHeaders = () => { const { assignmentName, updateUserName } = selectors.app.useModalData(); - const { currentGrade, originalGrade } = selectors.grades.useGradeData(); + const { gradeOverrideCurrentEarnedGradedOverride, gradeOriginalEarnedGraded } = selectors.grades.useGradeData(); const { formatMessage } = useIntl(); return (
@@ -39,12 +39,12 @@ export const ModalHeaders = () => {
); diff --git a/src/components/GradesView/EditModal/ModalHeaders.test.jsx b/src/components/GradesView/EditModal/ModalHeaders.test.jsx index 14d5ffe8..10b3421c 100644 --- a/src/components/GradesView/EditModal/ModalHeaders.test.jsx +++ b/src/components/GradesView/EditModal/ModalHeaders.test.jsx @@ -25,8 +25,8 @@ const modalData = { }; selectors.app.useModalData.mockReturnValue(modalData); const gradeData = { - currentGrade: 'test-current-grade', - originalGrade: 'test-original-grade', + gradeOverrideCurrentEarnedGradedOverride: 'test-current-grade', + gradeOriginalEarnedGraded: 'test-original-grade', }; selectors.grades.useGradeData.mockReturnValue(gradeData); @@ -70,7 +70,7 @@ describe('ModalHeaders', () => { expect(headerProps).toMatchObject({ id: HistoryKeys.originalGrade, label: formatMessage(messages.originalGradeHeader), - value: gradeData.originalGrade, + value: gradeData.gradeOriginalEarnedGraded, }); }); test('currentGrade header', () => { @@ -78,7 +78,7 @@ describe('ModalHeaders', () => { expect(headerProps).toMatchObject({ id: HistoryKeys.currentGrade, label: formatMessage(messages.currentGradeHeader), - value: gradeData.currentGrade, + value: gradeData.gradeOverrideCurrentEarnedGradedOverride, }); }); });