fix(curriculum): allow class and id to be in any order step 24 todo list (#57644)

Co-authored-by: Ilenia <26656284+ilenia-magoni@users.noreply.github.com>
Co-authored-by: Dario-DC <105294544+Dario-DC@users.noreply.github.com>
This commit is contained in:
Anna
2025-01-07 10:03:44 -05:00
committed by GitHub
parent e7897de0a2
commit c441efd704
2 changed files with 12 additions and 4 deletions

View File

@@ -14,13 +14,17 @@ Create a `div` element with the class of `task`. Utilize template strings to set
You should create a `div` element with the class `task`.
```js
assert.match(code, /<div\s+class\s*=\s*('|")task\1/)
const splitted = code.split(/tasksContainer\s*\.\s*innerHTML\s*\+=\s*`/)[1]
const matched = __helpers.removeJSComments(splitted).match(/<div(?<attributes>.*?)>\s*<\/\s*div\s*>/);
assert.match(matched?.groups.attributes, /\s+class\s*=\s*('|")task\1(\s|$)/);
```
Your `div` element should have the `id` `${id}`.
```js
assert.match(code, /<div\s+class\s*=\s*('|")task\1\s*id\s*=\s*('|")\$\{id\}\2\s*>\s*<\/div>/)
const splitted = code.split(/tasksContainer\s*\.\s*innerHTML\s*\+=\s*`/)[1]
const matched = __helpers.removeJSComments(splitted).match(/<div(?<attributes>.*?)>\s*<\/\s*div\s*>/);
assert.match(matched?.groups.attributes, /\s+id\s*=\s*('|")\$\{id\}\1(\s|$)/);
```
# --seed--

View File

@@ -14,13 +14,17 @@ Create a `div` element with the class of `task`. Utilize template strings to set
You should create a `div` element with the class `task`.
```js
assert.match(code, /<div\s+class\s*=\s*('|")task\1/)
const splitted = code.split(/tasksContainer\s*\.\s*innerHTML\s*\+=\s*`/)[1]
const matched = __helpers.removeJSComments(splitted).match(/<div(?<attributes>.*?)>\s*<\/\s*div\s*>/);
assert.match(matched?.groups.attributes, /\s+class\s*=\s*('|")task\1(\s|$)/);
```
Your `div` element should have the `id` `${id}`.
```js
assert.match(code, /<div\s+class\s*=\s*('|")task\1\s*id\s*=\s*('|")\$\{id\}\2\s*>\s*<\/div>/)
const splitted = code.split(/tasksContainer\s*\.\s*innerHTML\s*\+=\s*`/)[1]
const matched = __helpers.removeJSComments(splitted).match(/<div(?<attributes>.*?)>\s*<\/\s*div\s*>/);
assert.match(matched?.groups.attributes, /\s+id\s*=\s*('|")\$\{id\}\1(\s|$)/);
```
# --seed--