mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2025-12-23 21:04:36 -05:00
fix(curriculum): fix Building a Dice Game - Step 14 - passing with incorrect code (#57513)
Co-authored-by: Naomi <accounts+github@nhcarrigan.com>
This commit is contained in:
@@ -56,13 +56,18 @@ assert.strictEqual(scoreSpans[3].innerText, ", score = 30");
|
||||
If no straight is rolled, your `checkForStraights` function should enable the final radio button, set the value to `0`, and update the displayed text to `, score = 0`.
|
||||
|
||||
```js
|
||||
resetRadioOptions();
|
||||
checkForStraights([1,1,1,1,1]);
|
||||
assert.isTrue(scoreInputs[3].disabled);
|
||||
assert.isTrue(scoreInputs[4].disabled);
|
||||
assert.isFalse(scoreInputs[5].disabled);
|
||||
assert.strictEqual(scoreInputs[5].value, "0");
|
||||
assert.strictEqual(scoreSpans[5].innerText, ", score = 0");
|
||||
const assertNoStraight = (_diceValuesArr) => {
|
||||
resetRadioOptions();
|
||||
checkForStraights(_diceValuesArr);
|
||||
assert.isTrue(scoreInputs[3].disabled);
|
||||
assert.isTrue(scoreInputs[4].disabled);
|
||||
assert.isFalse(scoreInputs[5].disabled);
|
||||
assert.strictEqual(scoreInputs[5].value, "0");
|
||||
assert.strictEqual(scoreSpans[5].innerText, ", score = 0");
|
||||
}
|
||||
|
||||
assertNoStraight([1,1,1,1,1]);
|
||||
assertNoStraight([1,1,4,4,4]);
|
||||
```
|
||||
|
||||
You should call the `checkForStraights` function when the `rollDiceBtn` is clicked.
|
||||
|
||||
Reference in New Issue
Block a user