chore(curriculum): update asserts steps 24-25 in the magazine workshop (#61251)

This commit is contained in:
Samuel Oommen 2025-07-10 00:41:15 +05:30 committed by GitHub
parent 072903b586
commit d51e4ba7bb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 11 deletions

View File

@ -14,34 +14,34 @@ Within your `.image-quote` element, nest an `hr` element, a `p` element and a se
You should add two `hr` elements to your `.image-quote` element.
```js
assert(document.querySelectorAll('.image-quote hr')?.length === 2);
assert.lengthOf(document.querySelectorAll('.image-quote hr'), 2);
```
You should add a `p` element to your `.image-quote` element.
```js
assert(document.querySelectorAll('.image-quote p')?.length === 1);
assert.lengthOf(document.querySelectorAll('.image-quote p'), 1);
```
Your `.image-quote` children should be in the correct order.
```js
const children = document.querySelector('.image-quote')?.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 a `class` set to `quote`.
```js
assert(document.querySelector('.image-quote p')?.classList.contains('quote'));
assert.isTrue(document.querySelector('.image-quote p')?.classList.contains('quote'));
```
Your new `p` element should have the text `The millions of people who are learning to code through freeCodeCamp will have an even better resource to help them learn these fundamentals.`.
```js
assert(document.querySelector('.image-quote p')?.innerText === 'The millions of people who are learning to code through freeCodeCamp will have an even better resource to help them learn these fundamentals.');
assert.equal(document.querySelector('.image-quote p')?.innerText, 'The millions of people who are learning to code through freeCodeCamp will have an even better resource to help them learn these fundamentals.');
```
# --seed--

View File

@ -16,25 +16,25 @@ Set the `padding` and `margin` properties both to `0` and set the `box-sizing` p
You should have a `*, ::before, ::after` selector.
```js
assert(new __helpers.CSSHelp(document).getStyle('*, ::before, ::after'));
assert.exists(new __helpers.CSSHelp(document).getStyle('*, ::before, ::after'));
```
Your `*, ::before, ::after` selector should have a `padding` property set to `0`.
```js
assert(new __helpers.CSSHelp(document).getStyle('*, ::before, ::after')?.padding === '0px');
assert.equal(new __helpers.CSSHelp(document).getStyle('*, ::before, ::after')?.padding, '0px');
```
Your `*, ::before, ::after` selector should have a `margin` property set to `0`.
```js
assert(new __helpers.CSSHelp(document).getStyle('*, ::before, ::after')?.margin === '0px');
assert.equal(new __helpers.CSSHelp(document).getStyle('*, ::before, ::after')?.margin, '0px');
```
Your `*, ::before, ::after` selector should have a `box-sizing` property set to `border-box`.
```js
assert(new __helpers.CSSHelp(document).getStyle('*, ::before, ::after')?.boxSizing === 'border-box');
assert.equal(new __helpers.CSSHelp(document).getStyle('*, ::before, ::after')?.boxSizing, 'border-box');
```
# --seed--