fix(curriculum): misleading hint on Step 28 of Cat Photo App (#45994)

* Fix misleading hint on Step 28

* Require a src element for image

* Allow more than 2 figure elements

* Fix mistake with inequalities

* Change 4th test to only require an img element
This commit is contained in:
Benjamin Johnson
2022-05-23 05:30:34 -07:00
committed by GitHub
parent dd8e73fd6c
commit 3bf7c6023b

View File

@@ -14,13 +14,13 @@ Inside the `figure` element you just added, nest an `img` element with a `src` a
Your second `figure` element should have an opening tag. Opening tags have this syntax: `<elementName>`.
```js
assert(document.querySelectorAll('figure').length === 2);
assert(document.querySelectorAll('figure').length >= 2);
```
Your second `figure` element should have a closing tag. Closing tags have a `/` just after the `<` character.
```js
assert(code.match(/<\/figure>/g).length === 2);
assert(code.match(/<\/figure>/g).length >= 2);
```
There should be a second `figure` element right above the second `section` element's closing tag. You have them in the wrong order.
@@ -34,8 +34,7 @@ You should have a third `img` element nested in the `figure` element.
```js
const catsImg = document.querySelectorAll('figure > img')[1];
assert(
catsImg &&
catsImg.getAttribute('src').toLowerCase() === 'https://cdn.freecodecamp.org/curriculum/cat-photo-app/cats.jpg'
catsImg
);
```