chore: upgrade tests for accessibility quiz workshop (#59852)

This commit is contained in:
Ilenia
2025-04-24 03:48:07 +02:00
committed by GitHub
parent 03e166b15f
commit 34ee68faa8
2 changed files with 13 additions and 5 deletions

View File

@@ -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.

View File

@@ -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--