From 34ee68faa86e9bab00aee7e8935a17146b1b4b69 Mon Sep 17 00:00:00 2001 From: Ilenia <26656284+ilenia-magoni@users.noreply.github.com> Date: Thu, 24 Apr 2025 03:48:07 +0200 Subject: [PATCH] chore: upgrade tests for accessibility quiz workshop (#59852) --- .../6145e8b5080a5f06bb0223d0.md | 16 ++++++++++++---- .../614ccc21ea91ef1736b9b578.md | 2 +- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/curriculum/challenges/english/25-front-end-development/workshop-accessibility-quiz/6145e8b5080a5f06bb0223d0.md b/curriculum/challenges/english/25-front-end-development/workshop-accessibility-quiz/6145e8b5080a5f06bb0223d0.md index 5081cd04f1f..b58e5ef41bb 100644 --- a/curriculum/challenges/english/25-front-end-development/workshop-accessibility-quiz/6145e8b5080a5f06bb0223d0.md +++ b/curriculum/challenges/english/25-front-end-development/workshop-accessibility-quiz/6145e8b5080a5f06bb0223d0.md @@ -71,14 +71,18 @@ You should give the second `label` the text `True`. ```js const l = (n) => document.querySelectorAll('ul.answers-list > li > label')?.[n]?.textContent?.trim(); -assert(l(0) === 'False' ? l(1) === 'True' : true); +if (l(0) === 'False') { + assert.equal(l(1), 'True'); +} ``` You should give the second `label` the text `False`. ```js const l = (n) => document.querySelectorAll('ul.answers-list > li > label')?.[n]?.textContent?.trim(); -assert(l(0) === 'True' ? l(1) === 'False' : true); +if (l(0) === 'True') { + assert.equal(l(1), 'False'); +} ``` You should give the third `label` the text `True` or `False`. @@ -91,14 +95,18 @@ You should give the fourth `label` the text `True`. ```js const l = (n) => document.querySelectorAll('ul.answers-list > li > label')?.[n]?.textContent?.trim(); -assert(l(2) === 'False' ? l(3) === 'True' : true); +if (l(2) === 'False') { + assert.equal(l(3), 'True'); +} ``` You should give the fourth `label` the text `False`. ```js const l = (n) => document.querySelectorAll('ul.answers-list > li > label')?.[n]?.textContent?.trim(); -assert(l(2) === 'True' ? l(3) === 'False' : true); +if (l(2) === 'True') { + assert.equal(l(3), 'False'); +} ``` You should give the first `input` a `value` matching the `label` text content. diff --git a/curriculum/challenges/english/25-front-end-development/workshop-accessibility-quiz/614ccc21ea91ef1736b9b578.md b/curriculum/challenges/english/25-front-end-development/workshop-accessibility-quiz/614ccc21ea91ef1736b9b578.md index 1b44341cb56..0e215a72ff1 100644 --- a/curriculum/challenges/english/25-front-end-development/workshop-accessibility-quiz/614ccc21ea91ef1736b9b578.md +++ b/curriculum/challenges/english/25-front-end-development/workshop-accessibility-quiz/614ccc21ea91ef1736b9b578.md @@ -36,7 +36,7 @@ Your `link` element should have `rel="stylesheet"` and `href="styles.css"`. const link = document.querySelector("head>link"); assert.equal(link?.getAttribute("rel"), "stylesheet"); const href = link?.getAttribute("data-href"); -assert(href === "./styles.css" || href === "styles.css"); +assert.oneOf(href, ["./styles.css", "styles.css"]); ``` # --seed--