mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-09 12:00:37 -04:00
fix(curriculum): limit hardcoding roman numerals (#54819)
This commit is contained in:
@@ -170,6 +170,34 @@ convertBtnEl.click();
|
||||
assert.strictEqual(outputEl.innerText.trim(), 'MMMCMXCIX');
|
||||
```
|
||||
|
||||
When the `#number` element contains a random negative number and the `#convert-btn` element is clicked, the `#output` element should contain the text `"Please enter a number greater than or equal to 1"`.
|
||||
|
||||
```js
|
||||
const numberInputEl = document.getElementById('number');
|
||||
const convertBtnEl = document.getElementById('convert-btn');
|
||||
const outputEl = document.getElementById('output');
|
||||
|
||||
const randomNegativeNumber = Math.floor(Math.random() * -4000) - 2;
|
||||
|
||||
numberInputEl.value = randomNegativeNumber;
|
||||
convertBtnEl.click();
|
||||
assert.strictEqual(outputEl.innerText.trim().replace(/[.,?!]+$/g, '').toLowerCase(), 'please enter a number greater than or equal to 1');
|
||||
```
|
||||
|
||||
When the `#number` element contains a number greater than 4000 and the `#convert-btn` element is clicked, the `#output` element should contain the text `"Please enter a number less than or equal to 3999"`.
|
||||
|
||||
```js
|
||||
const numberInputEl = document.getElementById('number');
|
||||
const convertBtnEl = document.getElementById('convert-btn');
|
||||
const outputEl = document.getElementById('output');
|
||||
|
||||
const randomBigNumber = Math.floor(Math.random() * (1000000)) + 4000;
|
||||
|
||||
numberInputEl.value = randomBigNumber;
|
||||
convertBtnEl.click();
|
||||
assert.strictEqual(outputEl.innerText.trim().replace(/[.,?!]+$/g, '').toLowerCase(), 'please enter a number less than or equal to 3999');
|
||||
```
|
||||
|
||||
# --seed--
|
||||
|
||||
## --seed-contents--
|
||||
|
||||
Reference in New Issue
Block a user