Skip to content

Commit 7c1de69

Browse files
hassanwaqaHassan Waqar
andauthored
chore(curriculum): update two tests to use specific assert (freeCodeCamp#61006)
Co-authored-by: Hassan Waqar <[email protected]>
1 parent b25c5eb commit 7c1de69

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

curriculum/challenges/english/25-front-end-development/workshop-magazine/6143b9e1f5035c6e5f2a8231.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,12 @@ assert(document.querySelectorAll('.lists li')?.length === 6);
2929
Each of your new `li` elements should have an `h4` and `p` element.
3030
3131
```js
32-
const lis = [...document.querySelectorAll('.lists li')];
33-
assert(lis?.every(li => li?.children?.[0]?.localName === 'h4' && li?.children?.[1]?.localName === 'p'));
32+
const lis = document.querySelectorAll('.lists li');
33+
assert.isNotEmpty(lis);
34+
lis.forEach(li => {
35+
assert.equal(li?.children?.[0]?.localName, 'h4');
36+
assert.equal(li?.children?.[1]?.localName, 'p');
37+
});
3438
```
3539
3640
Your first `h4` should have the text `V1 - 2014`.
@@ -108,8 +112,11 @@ assert(document.querySelectorAll('.lists li p')?.[5]?.innerText === 'We launched
108112
Your six `h4` elements should each have the class `list-subtitle`.
109113
110114
```js
111-
const h4s = [...document.querySelectorAll('.lists li h4')];
112-
assert(h4s?.every(h4 => h4?.classList?.contains('list-subtitle')));
115+
const h4s = document.querySelectorAll('.lists li h4');
116+
assert.isNotEmpty(h4s);
117+
h4s.forEach(h4 => {
118+
assert.isTrue(h4?.classList?.contains('list-subtitle'));
119+
});
113120
```
114121
115122
# --seed--

0 commit comments

Comments
 (0)