-
Notifications
You must be signed in to change notification settings - Fork 350
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add test to document empty expression can be a correct answer #2003
base: jer/client-validation-4
Are you sure you want to change the base?
Conversation
@@ -125,12 +121,7 @@ export function scoreWidgetsFunctional( | |||
|
|||
const userInput = userInputMap[id]; | |||
const scorer = getWidgetScorer(widget.type); | |||
const score = scorer?.( | |||
userInput as UserInput, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This cast is no longer needed as we've tuned the types enough.
…be marked correct if coefficient == true
beforeEach(() => { | ||
jest.spyOn(Dependencies, "getDependencies").mockReturnValue( | ||
testDependencies, | ||
); | ||
}); | ||
|
||
it("is correct when input is empty but answer is 1 and coefficient: true", () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The expression
widget is based on KhanAnswerTypes. And within that file there's a special case where it interprets a completely empty input (aka ""
) as 1!
So this is a behavioural test to document this because it's very non-obvious unless you trace through the KhanAswerTypes!
Size Change: 0 B Total Size: 1.27 MB ℹ️ View Unchanged
|
Summary:
RendererUtil: remove unnecessary cast to UserInput
Issue: LEMS-2561
Test plan: