Skip to content

Commit

Permalink
fix: grade value is displayed in the modal
Browse files Browse the repository at this point in the history
  • Loading branch information
Dima Alipov authored and Dima Alipov committed Apr 21, 2024
1 parent c3823c3 commit d59a4bf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/components/GradesView/EditModal/ModalHeaders.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<div>
Expand All @@ -39,12 +39,12 @@ export const ModalHeaders = () => {
<HistoryHeader
id={HistoryKeys.originalGrade}
label={formatMessage(messages.originalGradeHeader)}
value={originalGrade}
value={gradeOriginalEarnedGraded}
/>
<HistoryHeader
id={HistoryKeys.currentGrade}
label={formatMessage(messages.currentGradeHeader)}
value={currentGrade}
value={gradeOverrideCurrentEarnedGradedOverride}
/>
</div>
);
Expand Down
8 changes: 4 additions & 4 deletions src/components/GradesView/EditModal/ModalHeaders.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -70,15 +70,15 @@ describe('ModalHeaders', () => {
expect(headerProps).toMatchObject({
id: HistoryKeys.originalGrade,
label: formatMessage(messages.originalGradeHeader),
value: gradeData.originalGrade,
value: gradeData.gradeOriginalEarnedGraded,
});
});
test('currentGrade header', () => {
const headerProps = el.instance.findByType(HistoryHeader)[3].props;
expect(headerProps).toMatchObject({
id: HistoryKeys.currentGrade,
label: formatMessage(messages.currentGradeHeader),
value: gradeData.currentGrade,
value: gradeData.gradeOverrideCurrentEarnedGradedOverride,
});
});
});
Expand Down

0 comments on commit d59a4bf

Please sign in to comment.