mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-04-30 16:01:14 -04:00
fix(curriculum): allow line breaks in option content in Calorie Counter step 10 (#52807)
This commit is contained in:
@@ -22,7 +22,7 @@ assert.equal(document.querySelectorAll('.controls select option')?.length, 5);
|
||||
Your first `option` should have the text `Breakfast`.
|
||||
|
||||
```js
|
||||
assert.equal(document.querySelectorAll('.controls select option')?.[0]?.textContent, 'Breakfast');
|
||||
assert.equal(document.querySelectorAll('.controls select option')?.[0]?.textContent?.trim(), 'Breakfast');
|
||||
```
|
||||
|
||||
Your first `option` should have the `value` attribute set to `breakfast`.
|
||||
@@ -34,7 +34,7 @@ assert.equal(document.querySelectorAll('.controls select option')?.[0]?.value, '
|
||||
Your second `option` should have the text `Lunch`.
|
||||
|
||||
```js
|
||||
assert.equal(document.querySelectorAll('.controls select option')?.[1]?.textContent, 'Lunch');
|
||||
assert.equal(document.querySelectorAll('.controls select option')?.[1]?.textContent?.trim(), 'Lunch');
|
||||
```
|
||||
|
||||
Your second `option` should have the `value` attribute set to `lunch`.
|
||||
@@ -46,7 +46,7 @@ assert.equal(document.querySelectorAll('.controls select option')?.[1]?.value, '
|
||||
Your third `option` should have the text `Dinner`.
|
||||
|
||||
```js
|
||||
assert.equal(document.querySelectorAll('.controls select option')?.[2]?.textContent, 'Dinner');
|
||||
assert.equal(document.querySelectorAll('.controls select option')?.[2]?.textContent?.trim(), 'Dinner');
|
||||
```
|
||||
|
||||
Your third `option` should have the `value` attribute set to `dinner`.
|
||||
@@ -58,7 +58,7 @@ assert.equal(document.querySelectorAll('.controls select option')?.[2]?.value, '
|
||||
Your fourth `option` should have the text `Snacks`.
|
||||
|
||||
```js
|
||||
assert.equal(document.querySelectorAll('.controls select option')?.[3]?.textContent, 'Snacks');
|
||||
assert.equal(document.querySelectorAll('.controls select option')?.[3]?.textContent?.trim(), 'Snacks');
|
||||
```
|
||||
|
||||
Your fourth `option` should have the `value` attribute set to `snacks`.
|
||||
@@ -70,7 +70,7 @@ assert.equal(document.querySelectorAll('.controls select option')?.[3]?.value, '
|
||||
Your fifth `option` should have the text `Exercise`.
|
||||
|
||||
```js
|
||||
assert.equal(document.querySelectorAll('.controls select option')?.[4]?.textContent, 'Exercise');
|
||||
assert.equal(document.querySelectorAll('.controls select option')?.[4]?.textContent?.trim(), 'Exercise');
|
||||
```
|
||||
|
||||
Your fifth `option` should have the `value` attribute set to `exercise`.
|
||||
@@ -82,7 +82,9 @@ assert.equal(document.querySelectorAll('.controls select option')?.[4]?.value, '
|
||||
Your first `option` should be selected by default.
|
||||
|
||||
```js
|
||||
assert.isTrue(document.querySelectorAll('.controls select option')?.[0]?.getAttributeNames()?.includes('selected'));
|
||||
const isFirstOptionSelected = document.querySelectorAll('.controls select option')?.[0]?.getAttributeNames()?.includes('selected');
|
||||
const selectedOptions = document.querySelectorAll('.controls select option[selected]');
|
||||
assert.isTrue(isFirstOptionSelected && selectedOptions.length === 1);
|
||||
```
|
||||
|
||||
# --seed--
|
||||
|
||||
Reference in New Issue
Block a user