fix(curriculum): limit hardcoding roman numerals (#54819)

This commit is contained in:
Anna
2024-06-06 02:40:08 -04:00
committed by GitHub
parent d3828933c1
commit e5adb9444f

View File

@@ -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--