Skip to content

Commit 10705bc

Browse files
irtazaakramfeanil
authored andcommitted
fix: test failures
1 parent 2e836a5 commit 10705bc

4 files changed

Lines changed: 11 additions & 5 deletions

File tree

src/editors/containers/ProblemEditor/components/EditProblemView/SettingsWidget/settingsComponents/ScoringCard.jsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,12 @@ const ScoringCard = ({
5151
return (
5252
<SettingsOption
5353
title={intl.formatMessage(messages.scoringSettingsTitle)}
54-
summary={getScoringSummary(scoring.weight, scoring.attempts.number, scoring.attempts.unlimited, scoring.gradingMethod)}
54+
summary={getScoringSummary(
55+
scoring.weight,
56+
scoring.attempts.number,
57+
scoring.attempts.unlimited,
58+
scoring.gradingMethod,
59+
)}
5560
className="scoringCard"
5661
>
5762
<div className="mb-4">

src/editors/containers/ProblemEditor/components/EditProblemView/SettingsWidget/settingsComponents/ScoringCard.test.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ describe('ScoringCard', () => {
6767
const gradingSelect = screen.getByRole('combobox', { name: 'Grading method' });
6868
expect(gradingSelect).toBeInTheDocument();
6969
expect(gradingSelect.value).toBe(GradingMethodKeys.LAST_SCORE);
70-
70+
7171
fireEvent.change(gradingSelect, { target: { value: GradingMethodKeys.HIGHEST_SCORE } });
7272
expect(props.updateSettings).toHaveBeenCalled();
7373
});

src/editors/data/redux/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import * as video from './video';
99
import * as problem from './problem';
1010
import * as game from './game';
1111
import type { RequestKeys, RequestStates } from '../constants/requests';
12-
import { AdvancedProblemType, ProblemType } from '../constants/problem';
12+
import { AdvancedProblemType, GradingMethodKeys, ProblemType } from '../constants/problem';
1313

1414
export { default as thunkActions } from './thunkActions';
1515

@@ -175,7 +175,8 @@ export interface EditorState {
175175
randomization: null | any; // Not sure what type this field has
176176
scoring: {
177177
weight: number;
178-
attempts: { unlimited: boolean; number: number | null; }
178+
attempts: { unlimited: boolean; number: number | null; };
179+
gradingMethod: GradingMethodKeys.LAST_SCORE;
179180
},
180181
hints: any[];
181182
timeBetween: number;

src/editors/data/redux/problem/reducers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const initialState: EditorState['problem'] = {
2929
unlimited: true,
3030
number: null,
3131
},
32-
gradingMethod: GradingMethodKeys.LAST_SCORE
32+
gradingMethod: GradingMethodKeys.LAST_SCORE,
3333
},
3434
hints: [],
3535
timeBetween: 0,

0 commit comments

Comments
 (0)