fix: test failures
This commit is contained in:
committed by
Feanil Patel
parent
2e836a55cf
commit
10705bc921
@@ -51,7 +51,12 @@ const ScoringCard = ({
|
||||
return (
|
||||
<SettingsOption
|
||||
title={intl.formatMessage(messages.scoringSettingsTitle)}
|
||||
summary={getScoringSummary(scoring.weight, scoring.attempts.number, scoring.attempts.unlimited, scoring.gradingMethod)}
|
||||
summary={getScoringSummary(
|
||||
scoring.weight,
|
||||
scoring.attempts.number,
|
||||
scoring.attempts.unlimited,
|
||||
scoring.gradingMethod,
|
||||
)}
|
||||
className="scoringCard"
|
||||
>
|
||||
<div className="mb-4">
|
||||
|
||||
@@ -67,7 +67,7 @@ describe('ScoringCard', () => {
|
||||
const gradingSelect = screen.getByRole('combobox', { name: 'Grading method' });
|
||||
expect(gradingSelect).toBeInTheDocument();
|
||||
expect(gradingSelect.value).toBe(GradingMethodKeys.LAST_SCORE);
|
||||
|
||||
|
||||
fireEvent.change(gradingSelect, { target: { value: GradingMethodKeys.HIGHEST_SCORE } });
|
||||
expect(props.updateSettings).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
@@ -9,7 +9,7 @@ import * as video from './video';
|
||||
import * as problem from './problem';
|
||||
import * as game from './game';
|
||||
import type { RequestKeys, RequestStates } from '../constants/requests';
|
||||
import { AdvancedProblemType, ProblemType } from '../constants/problem';
|
||||
import { AdvancedProblemType, GradingMethodKeys, ProblemType } from '../constants/problem';
|
||||
|
||||
export { default as thunkActions } from './thunkActions';
|
||||
|
||||
@@ -175,7 +175,8 @@ export interface EditorState {
|
||||
randomization: null | any; // Not sure what type this field has
|
||||
scoring: {
|
||||
weight: number;
|
||||
attempts: { unlimited: boolean; number: number | null; }
|
||||
attempts: { unlimited: boolean; number: number | null; };
|
||||
gradingMethod: GradingMethodKeys.LAST_SCORE;
|
||||
},
|
||||
hints: any[];
|
||||
timeBetween: number;
|
||||
|
||||
@@ -29,7 +29,7 @@ const initialState: EditorState['problem'] = {
|
||||
unlimited: true,
|
||||
number: null,
|
||||
},
|
||||
gradingMethod: GradingMethodKeys.LAST_SCORE
|
||||
gradingMethod: GradingMethodKeys.LAST_SCORE,
|
||||
},
|
||||
hints: [],
|
||||
timeBetween: 0,
|
||||
|
||||
Reference in New Issue
Block a user