From 2dad3665dc71aba32f67bd861b14e2a3ecd50154 Mon Sep 17 00:00:00 2001 From: Gagan Bhullar Date: Fri, 27 Sep 2024 21:30:20 -0600 Subject: [PATCH] fix(curriculum): cat photo app workshop update step 2 (#56318) Co-authored-by: Krzysztof G. <60067306+gikf@users.noreply.github.com> --- .../6690b9626a66f51257ae5a91.md | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/curriculum/challenges/english/25-front-end-development/workshop-cat-photo-app/6690b9626a66f51257ae5a91.md b/curriculum/challenges/english/25-front-end-development/workshop-cat-photo-app/6690b9626a66f51257ae5a91.md index 020e1808e04..5bb42889b8b 100644 --- a/curriculum/challenges/english/25-front-end-development/workshop-cat-photo-app/6690b9626a66f51257ae5a91.md +++ b/curriculum/challenges/english/25-front-end-development/workshop-cat-photo-app/6690b9626a66f51257ae5a91.md @@ -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: ``. ```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: ``. ```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: ``. ```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--