fix(curriculum): description and tests for step 44 calorie counter (#53329)

This commit is contained in:
Jessica Wilkins
2024-01-23 01:10:17 -08:00
committed by GitHub
parent dc56ffa004
commit 8b034ff703
2 changed files with 8 additions and 12 deletions

View File

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

View File

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