fix(curriculum): cat photo app workshop update step 2 (#56318)

Co-authored-by: Krzysztof G. <60067306+gikf@users.noreply.github.com>
main
Gagan Bhullar 2024-09-27 21:30:20 -06:00 committed by GitHub
parent aba155c4c6
commit 2dad3665dc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 10 additions and 12 deletions

View File

@ -29,45 +29,43 @@ Below the `h1` element, add an `h2` element with this text:
Your `h1` element should have an opening tag. Opening tags have this syntax: `<elementName>`.
```js
assert(document.querySelector('h1'));
assert.exists(document.querySelector('h1'));
```
Your `h1` element should have a closing tag. Closing tags have a `/` just after the `<` character.
Your `h1` element should have a closing tag. Closing tags have this syntax: `</elementName>`.
```js
assert(code.match(/<\/h1\>/));
assert.match(code, /<\/h1\>/);
```
You should only have one `h1` element. Remove the extra.
```js
assert(
document.querySelector('h1') && document.querySelectorAll('h1').length === 1
);
assert.lengthOf(document.querySelectorAll('h1'), 1);
```
Your `h1` element's text should be 'CatPhotoApp'. You have either omitted the text or have a typo.
```js
assert(document.querySelector('h1').innerText.toLowerCase() === 'catphotoapp');
assert.equal(document.querySelector('h1').innerText.toLowerCase(), 'catphotoapp');
```
Your `h2` element should have an opening tag. Opening tags have this syntax: `<elementName>`.
```js
assert(document.querySelector('h2'));
assert.exists(document.querySelector('h2'));
```
Your `h2` element should have a closing tag. Closing tags have a `/` just after the `<` character.
```js
assert(code.match(/<\/h2\>/));
assert.match(code, /<\/h2\>/);
```
Your `h2` element's text should be 'Cat Photos'. Only place the text `Cat Photos` between the opening and closing `h2` tags.
Your `h2` element's text should be `Cat Photos`. Only place the text `Cat Photos` between the opening and closing `h2` tags.
```js
assert(document.querySelector('h2').innerText.toLowerCase() === 'cat photos');
assert.equal(document.querySelector('h2').innerText.toLowerCase(), 'cat photos');
```
Your `h2` element should be below the `h1` element. The `h1` element has greater importance and must be above the `h2` element.
@ -76,7 +74,7 @@ Your `h2` element should be below the `h1` element. The `h1` element has greater
const collection = [...document.querySelectorAll('h1,h2')].map(
(node) => node.nodeName
);
assert(collection.indexOf('H1') < collection.indexOf('H2'));
assert.isBelow(collection.indexOf('H1'), collection.indexOf('H2'));
```
# --seed--