mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
chore: upgrade tests for accessibility quiz workshop (#59852)
This commit is contained in:
+12
-4
@@ -71,14 +71,18 @@ You should give the second `label` the text `True`.
|
|||||||
|
|
||||||
```js
|
```js
|
||||||
const l = (n) => document.querySelectorAll('ul.answers-list > li > label')?.[n]?.textContent?.trim();
|
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`.
|
You should give the second `label` the text `False`.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
const l = (n) => document.querySelectorAll('ul.answers-list > li > label')?.[n]?.textContent?.trim();
|
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`.
|
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
|
```js
|
||||||
const l = (n) => document.querySelectorAll('ul.answers-list > li > label')?.[n]?.textContent?.trim();
|
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`.
|
You should give the fourth `label` the text `False`.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
const l = (n) => document.querySelectorAll('ul.answers-list > li > label')?.[n]?.textContent?.trim();
|
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.
|
You should give the first `input` a `value` matching the `label` text content.
|
||||||
|
|||||||
+1
-1
@@ -36,7 +36,7 @@ Your `link` element should have `rel="stylesheet"` and `href="styles.css"`.
|
|||||||
const link = document.querySelector("head>link");
|
const link = document.querySelector("head>link");
|
||||||
assert.equal(link?.getAttribute("rel"), "stylesheet");
|
assert.equal(link?.getAttribute("rel"), "stylesheet");
|
||||||
const href = link?.getAttribute("data-href");
|
const href = link?.getAttribute("data-href");
|
||||||
assert(href === "./styles.css" || href === "styles.css");
|
assert.oneOf(href, ["./styles.css", "styles.css"]);
|
||||||
```
|
```
|
||||||
|
|
||||||
# --seed--
|
# --seed--
|
||||||
|
|||||||
Reference in New Issue
Block a user