mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
fix(curriculum): update workshop-magazine steps 13,18 to use specific asserts (#61120)
This commit is contained in:
committed by
GitHub
parent
4865efb3fa
commit
5c61f3e3e0
+7
-7
@@ -22,13 +22,13 @@ assert.exists(document.querySelector('.text blockquote'));
|
||||
Your `blockquote` element should come after your three `p` elements.
|
||||
|
||||
```js
|
||||
assert(document.querySelector('.text')?.children?.[3]?.localName === 'blockquote');
|
||||
assert.equal(document.querySelector('.text')?.children?.[3]?.localName, 'blockquote');
|
||||
```
|
||||
|
||||
Your `blockquote` element should have two `hr` elements.
|
||||
|
||||
```js
|
||||
assert(document.querySelectorAll('.text blockquote hr')?.length === 2);
|
||||
assert.lengthOf(document.querySelectorAll('.text blockquote hr'), 2);
|
||||
```
|
||||
|
||||
Your `blockquote` element should have a `p` element.
|
||||
@@ -41,21 +41,21 @@ Your `blockquote` children should be in the correct order.
|
||||
|
||||
```js
|
||||
const children = document.querySelector('.text blockquote')?.children;
|
||||
assert(children?.[0]?.localName === 'hr');
|
||||
assert(children?.[1]?.localName === 'p');
|
||||
assert(children?.[2]?.localName === 'hr');
|
||||
assert.equal(children?.[0]?.localName, 'hr');
|
||||
assert.equal(children?.[1]?.localName, 'p');
|
||||
assert.equal(children?.[2]?.localName, 'hr');
|
||||
```
|
||||
|
||||
Your new `p` element should have the `class` set to `quote`.
|
||||
|
||||
```js
|
||||
assert(document.querySelector('.text blockquote p')?.className === 'quote');
|
||||
assert.equal(document.querySelector('.text blockquote p')?.className, 'quote');
|
||||
```
|
||||
|
||||
Your new `p` element should have the text `The entire curriculum should be a series of projects`.
|
||||
|
||||
```js
|
||||
assert(document.querySelector('.text blockquote p')?.innerText === 'The entire curriculum should be a series of projects');
|
||||
assert.equal(document.querySelector('.text blockquote p')?.innerText, 'The entire curriculum should be a series of projects');
|
||||
```
|
||||
|
||||
# --seed--
|
||||
|
||||
+7
-7
@@ -33,33 +33,33 @@ Your elements within the `article` element should be in the correct order.
|
||||
|
||||
```js
|
||||
const children = document.querySelector('article')?.children;
|
||||
assert(children?.[0]?.localName === 'h3');
|
||||
assert(children?.[1]?.localName === 'p');
|
||||
assert(children?.[2]?.localName === 'ul');
|
||||
assert.equal(children?.[0]?.localName, 'h3');
|
||||
assert.equal(children?.[1]?.localName, 'p');
|
||||
assert.equal(children?.[2]?.localName, 'ul');
|
||||
```
|
||||
|
||||
Your new `h3` element should have the `class` set to `list-title`.
|
||||
|
||||
```js
|
||||
assert(document.querySelector('article h3')?.className === 'list-title');
|
||||
assert.equal(document.querySelector('article h3')?.className, 'list-title');
|
||||
```
|
||||
|
||||
Your new `h3` element should have the text of `A Brief History`.
|
||||
|
||||
```js
|
||||
assert(document.querySelector('article h3')?.innerText === 'A Brief History');
|
||||
assert.equal(document.querySelector('article h3')?.innerText, 'A Brief History');
|
||||
```
|
||||
|
||||
Your new `p` element should have the text of `Of the Curriculum`.
|
||||
|
||||
```js
|
||||
assert(document.querySelector('article p')?.innerText === 'Of the Curriculum');
|
||||
assert.equal(document.querySelector('article p')?.innerText, 'Of the Curriculum');
|
||||
```
|
||||
|
||||
Your new `ul` element should have the `class` set to `lists`.
|
||||
|
||||
```js
|
||||
assert(document.querySelector('article ul')?.className === 'lists');
|
||||
assert.equal(document.querySelector('article ul')?.className, 'lists');
|
||||
```
|
||||
|
||||
# --seed--
|
||||
|
||||
Reference in New Issue
Block a user