fix(curriculum): fix broken HTML in Calorie Counter (#57170)

This commit is contained in:
Supravisor
2024-12-10 21:01:15 +13:00
committed by GitHub
parent 52f1f27179
commit dd2eaba402
@@ -27,7 +27,7 @@ Your `input` element should have a `type` attribute set to `text`.
```js
const HTMLstring = code.split(/HTMLString\s*=/)[1];
const inputAttributes = HTMLstring.match(/<input\s+.*?>/)[0];
const inputAttributes = HTMLstring.match(/<input\s+.*/)[0];
assert.match(inputAttributes, /type\s*=\s*"text"/);
```
@@ -35,7 +35,7 @@ Your `input` element should have a `placeholder` attribute set to `Name`.
```js
const HTMLstring = code.split(/HTMLString\s*=/)[1];
const inputAttributes = HTMLstring.match(/<input\s+.*?>/)[0];
const inputAttributes = HTMLstring.match(/<input\s+.*/)[0];
assert.match(inputAttributes, /placeholder\s*=\s*"Name"/);
```
@@ -43,10 +43,22 @@ Your `input` element should have an `id` attribute set to `${entryDropdown.value
```js
const HTMLstring = code.split(/HTMLString\s*=/)[1];
const inputAttributes = HTMLstring.match(/<input\s+.*?>/)[0];
const inputAttributes = HTMLstring.match(/<input\s+.*/)[0];
assert.match(inputAttributes, /id\s*=\s*"\${entryDropdown.value}-\${entryNumber}-name"/);
```
You should not have a closing `input` tag in your code.
```js
assert.notMatch(code, /<\/input>/);
```
The `input` element should have the closing `>`.
```js
assert.match(code, /HTMLString\s*=\s*`\n\s*<label\s+for\s*=\s*"\$\{entryDropdown\.value\}-\$\{entryNumber\}-name"\s*>Entry\s\$\{entryNumber\}\sName<\/label>\n\s*<input\s+[^>]*>/);
```
# --seed--
## --seed-contents--