From 3b30aa5ff74c19d6fd6444a936c0bc0d82d124ad Mon Sep 17 00:00:00 2001 From: Mohamad Salman <139472418+MohamadSalman11@users.noreply.github.com> Date: Wed, 2 Apr 2025 18:35:03 +0200 Subject: [PATCH] fix(curriculum): improve test fail message for the src attribute in Step 32 (#59040) Co-authored-by: Ilenia <26656284+ilenia-magoni@users.noreply.github.com> Co-authored-by: sembauke --- .../5efae0543cbd2bbdab94e333.md | 12 +++++++++--- .../5efae0543cbd2bbdab94e333.md | 11 +++++++++-- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/curriculum/challenges/english/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5efae0543cbd2bbdab94e333.md b/curriculum/challenges/english/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5efae0543cbd2bbdab94e333.md index 67e7fe3252b..2d1d48e0681 100644 --- a/curriculum/challenges/english/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5efae0543cbd2bbdab94e333.md +++ b/curriculum/challenges/english/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5efae0543cbd2bbdab94e333.md @@ -35,9 +35,15 @@ The Cats `img` element should be 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' +assert.exists(catsImg); +``` + +The third image should have a `src` attribute set to `https://cdn.freecodecamp.org/curriculum/cat-photo-app/cats.jpg`. + +```js +const catsImg = document.querySelectorAll('figure > img')[1]; +assert.strictEqual( + catsImg?.src?.toLowerCase(), 'https://cdn.freecodecamp.org/curriculum/cat-photo-app/cats.jpg' ); ``` diff --git a/curriculum/challenges/english/25-front-end-development/workshop-cat-photo-app/5efae0543cbd2bbdab94e333.md b/curriculum/challenges/english/25-front-end-development/workshop-cat-photo-app/5efae0543cbd2bbdab94e333.md index 3147f20960c..fc47c5fce88 100644 --- a/curriculum/challenges/english/25-front-end-development/workshop-cat-photo-app/5efae0543cbd2bbdab94e333.md +++ b/curriculum/challenges/english/25-front-end-development/workshop-cat-photo-app/5efae0543cbd2bbdab94e333.md @@ -35,8 +35,15 @@ The Cats `img` element should be nested in the `figure` element. ```js const catsImg = document.querySelectorAll('figure > img')[1]; -assert.equal( - catsImg?.getAttribute('src')?.toLowerCase(), 'https://cdn.freecodecamp.org/curriculum/cat-photo-app/cats.jpg' +assert.exists(catsImg); +``` + +The third image should have a `src` attribute set to `https://cdn.freecodecamp.org/curriculum/cat-photo-app/cats.jpg`. + +```js +const catsImg = document.querySelectorAll('figure > img')[1]; +assert.strictEqual( + catsImg?.src?.toLowerCase(), 'https://cdn.freecodecamp.org/curriculum/cat-photo-app/cats.jpg' ); ```