mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-06-02 16:01:34 -04:00
fix(curriculum): updated assert methods (#60089)
This commit is contained in:
@@ -14,37 +14,37 @@ Create two `div` elements, the first inside the `.cat-left-ear` element with a c
|
||||
You should not change the existing `div` element with the class `cat-left-ear`.
|
||||
|
||||
```js
|
||||
assert(document.querySelectorAll('div.cat-left-ear').length === 1);
|
||||
assert.lengthOf(document.querySelectorAll('div.cat-left-ear'), 1);
|
||||
```
|
||||
|
||||
You should not change the existing `div` element with the class `cat-right-ear`.
|
||||
|
||||
```js
|
||||
assert(document.querySelectorAll('div.cat-right-ear').length === 1);
|
||||
assert.lengthOf(document.querySelectorAll('div.cat-right-ear'), 1);
|
||||
```
|
||||
|
||||
You should have one `div` element inside your `.cat-left-ear` element.
|
||||
|
||||
```js
|
||||
assert(document.querySelectorAll('.cat-left-ear div').length === 1);
|
||||
assert.lengthOf(document.querySelectorAll('.cat-left-ear div'), 1);
|
||||
```
|
||||
|
||||
You should have one `div` element inside your `.cat-right-ear` element.
|
||||
|
||||
```js
|
||||
assert(document.querySelectorAll('.cat-right-ear div').length === 1);
|
||||
assert.lengthOf(document.querySelectorAll('.cat-right-ear div'), 1);
|
||||
```
|
||||
|
||||
The new `div` element inside `.cat-left-ear` should have the class `cat-left-inner-ear`.
|
||||
|
||||
```js
|
||||
assert(document.querySelectorAll('.cat-left-ear div')[0]?.classList.contains('cat-left-inner-ear'));
|
||||
assert.isTrue(document.querySelectorAll('.cat-left-ear div')[0]?.classList.contains('cat-left-inner-ear'));
|
||||
```
|
||||
|
||||
The new `div` element inside `.cat-right-ear` should have the class `cat-right-inner-ear`.
|
||||
|
||||
```js
|
||||
assert(document.querySelectorAll('.cat-right-ear div')[0]?.classList.contains('cat-right-inner-ear'));
|
||||
assert.isTrue(document.querySelectorAll('.cat-right-ear div')[0]?.classList.contains('cat-right-inner-ear'));
|
||||
```
|
||||
|
||||
# --seed--
|
||||
|
||||
Reference in New Issue
Block a user