mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-03-28 23:01:57 -04:00
fix(curriculum): description and tests for step 44 calorie counter (#53329)
This commit is contained in:
@@ -20,7 +20,7 @@ assert.match(addEntry.toString(), /HTMLString\s*=/)
|
||||
Your `HTMLString` should be an empty template literal.
|
||||
|
||||
```js
|
||||
assert.match(code, /HTMLString\s*=\s*``/);
|
||||
assert.match(code, /HTMLString\s*=\s*`\n?\s*`/);
|
||||
```
|
||||
|
||||
# --seed--
|
||||
|
||||
@@ -7,17 +7,11 @@ dashedName: step-44
|
||||
|
||||
# --description--
|
||||
|
||||
Start your `HTMLString` with a new line, then create a `label` element. Give that element the text `Entry # Name`, using your template literal syntax to replace `#` with the value of `entryNumber`.
|
||||
Inside your template literal, create a `label` element and give it the text `Entry # Name`. Using your template literal syntax, replace `#` with the value of `entryNumber`.
|
||||
|
||||
# --hints--
|
||||
|
||||
Your `HTMLString` variable should start with a new line.
|
||||
|
||||
```js
|
||||
assert.match(code, /HTMLString\s*=\s*`\n/);
|
||||
```
|
||||
|
||||
You should add a `label` element on the new line.
|
||||
You should have a `label` element inside your template literal.
|
||||
|
||||
```js
|
||||
assert.match(code, /HTMLString\s*=\s*`\n\s*<label>.*<\/label>/);
|
||||
@@ -219,11 +213,13 @@ function isInvalidInput(str) {
|
||||
return str.match(regex);
|
||||
}
|
||||
|
||||
--fcc-editable-region--
|
||||
function addEntry() {
|
||||
const targetInputContainer = document.querySelector(`#${entryDropdown.value} .input-container`);
|
||||
const entryNumber = targetInputContainer.querySelectorAll('input[type="text"]').length;
|
||||
const HTMLString = ``;
|
||||
const HTMLString = `
|
||||
--fcc-editable-region--
|
||||
|
||||
--fcc-editable-region--
|
||||
`;
|
||||
}
|
||||
--fcc-editable-region--
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user