mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
chore(curriculum): update two tests to use specific asserts (#60981)
This commit is contained in:
+15
-4
@@ -26,15 +26,26 @@ assert(document.querySelectorAll('i')?.length === 5);
|
||||
Each `a` element should only have one `i` element.
|
||||
|
||||
```js
|
||||
const aaaaa = [...document.querySelectorAll('.social-icons a')];
|
||||
assert(aaaaa?.every(a => a?.children?.length === 1 && a?.children?.[0]?.localName === 'i'));
|
||||
const aaaaa = document.querySelectorAll('.social-icons a');
|
||||
assert.lengthOf(aaaaa, 5);
|
||||
aaaaa?.forEach(
|
||||
a => {
|
||||
assert.lengthOf(a?.children, 1);
|
||||
assert.equal(a?.children?.[0]?.localName, 'i');
|
||||
}
|
||||
);
|
||||
```
|
||||
|
||||
Each `i` element should have a `class` attribute which includes `fab`.
|
||||
|
||||
```js
|
||||
const iiiii = [...document.querySelectorAll('i')];
|
||||
assert(iiiii?.every(i => i?.classList?.contains('fab')));
|
||||
const iiiii = document.querySelectorAll('i');
|
||||
assert.lengthOf(iiiii, 5);
|
||||
iiiii?.forEach(
|
||||
i => {
|
||||
assert.isTrue(i?.classList?.contains('fab'));
|
||||
}
|
||||
);
|
||||
```
|
||||
|
||||
The first `i` element should have a `class` attribute which includes `fa-facebook-f`.
|
||||
|
||||
Reference in New Issue
Block a user