Skip to content

Commit 98d00be

Browse files
committed
WIP
1 parent 194cd49 commit 98d00be

File tree

52 files changed

+486
-83
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+486
-83
lines changed

generate-act-tests.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ const rulesToIgnore = [
113113
"off6ek",
114114
"oj04fd",
115115
"ucwvc8",
116-
"ye5d6e",
117116
"bf051a",
118117
];
119118

@@ -172,9 +171,9 @@ const parser = new DOMParser();
172171
173172
describe("[${ruleId}]${ruleName}", function () {
174173
it("${testcaseTitle} (${exampleURL})", async () => {
175-
const document = parser.parseFromString(\`${html}\`, 'text/html');
174+
const el = parser.parseFromString(\`${html}\`, 'text/html');
176175
177-
const results = (await scan(document.body)).map(({ text, url }) => {
176+
const results = (await scan(el)).map(({ text, url }) => {
178177
return { text, url };
179178
});
180179

src/rules/bypass.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,14 @@ export default function (el: Document | Element): AccessibilityError[] {
1313

1414
let hasInstrument = false;
1515

16+
// Loop over all the links and see if there's a instrucment to skip to the main content.
17+
// If there's a link
1618
for (const link of links) {
17-
const target = querySelector(link.getAttribute("href")!, document);
19+
const href = link.getAttribute("href")!;
20+
const target = querySelector(href, document);
1821
if (target?.parentElement?.isSameNode(document.body)) hasInstrument = true;
1922
}
20-
if (hasInstrument) {
23+
if (!hasInstrument) {
2124
errors.push({
2225
element: document.body,
2326
text,

tests/act/tests/c487ae/014295a8bd7213fdbd69bc1c8ee44c48268370ec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ const parser = new DOMParser();
55

66
describe("[c487ae]Link has non-empty accessible name", function () {
77
it("Passed Example 8 (https://act-rules.github.io/testcases/c487ae/014295a8bd7213fdbd69bc1c8ee44c48268370ec.html)", async () => {
8-
const document = parser.parseFromString(`<!DOCTYPE html> <a href="https://www.w3.org/WAI"><img src="/test-assets/shared/w3c-logo.png" aria-labelledby="id1"/></a>
8+
const el = parser.parseFromString(`<!DOCTYPE html> <a href="https://www.w3.org/WAI"><img src="/test-assets/shared/w3c-logo.png" aria-labelledby="id1"/></a>
99
<div id="id1">Web Accessibility Initiative (WAI)</div>`, 'text/html');
1010

11-
const results = (await scan(document.body)).map(({ text, url }) => {
11+
const results = (await scan(el)).map(({ text, url }) => {
1212
return { text, url };
1313
});
1414

tests/act/tests/c487ae/03653844ceb8f6cd95af81672123ea98323ce5c8.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ const parser = new DOMParser();
55

66
describe("[c487ae]Link has non-empty accessible name", function () {
77
it("Passed Example 5 (https://act-rules.github.io/testcases/c487ae/03653844ceb8f6cd95af81672123ea98323ce5c8.html)", async () => {
8-
const document = parser.parseFromString(`<!DOCTYPE html> <a href="https://www.w3.org/WAI" title="Web Accessibility Initiative"
8+
const el = parser.parseFromString(`<!DOCTYPE html> <a href="https://www.w3.org/WAI" title="Web Accessibility Initiative"
99
><img src="/test-assets/shared/w3c-logo.png" alt=""
1010
/></a>`, 'text/html');
1111

12-
const results = (await scan(document.body)).map(({ text, url }) => {
12+
const results = (await scan(el)).map(({ text, url }) => {
1313
return { text, url };
1414
});
1515

tests/act/tests/c487ae/0d7a7862c5b414c272f1713c341d821f5249a15d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ const parser = new DOMParser();
55

66
describe("[c487ae]Link has non-empty accessible name", function () {
77
it("Passed Example 4 (https://act-rules.github.io/testcases/c487ae/0d7a7862c5b414c272f1713c341d821f5249a15d.html)", async () => {
8-
const document = parser.parseFromString(`<!DOCTYPE html> <a href="https://www.w3.org/WAI"
8+
const el = parser.parseFromString(`<!DOCTYPE html> <a href="https://www.w3.org/WAI"
99
><img src="/test-assets/shared/w3c-logo.png" aria-label="Web Accessibility Initiative"
1010
/></a>`, 'text/html');
1111

12-
const results = (await scan(document.body)).map(({ text, url }) => {
12+
const results = (await scan(el)).map(({ text, url }) => {
1313
return { text, url };
1414
});
1515

tests/act/tests/c487ae/113298e42bd5a240371affac3747a470c617610b.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ const parser = new DOMParser();
55

66
describe("[c487ae]Link has non-empty accessible name", function () {
77
it("Failed Example 1 (https://act-rules.github.io/testcases/c487ae/113298e42bd5a240371affac3747a470c617610b.html)", async () => {
8-
const document = parser.parseFromString(`<!DOCTYPE html> <a href="http://www.w3.org/WAI"></a>`, 'text/html');
8+
const el = parser.parseFromString(`<!DOCTYPE html> <a href="http://www.w3.org/WAI"></a>`, 'text/html');
99

10-
const results = (await scan(document.body)).map(({ text, url }) => {
10+
const results = (await scan(el)).map(({ text, url }) => {
1111
return { text, url };
1212
});
1313

tests/act/tests/c487ae/1752fb0c94ce17c6557a7e498c6e9a87c6a943ea.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ const parser = new DOMParser();
55

66
describe("[c487ae]Link has non-empty accessible name", function () {
77
it("Passed Example 10 (https://act-rules.github.io/testcases/c487ae/1752fb0c94ce17c6557a7e498c6e9a87c6a943ea.html)", async () => {
8-
const document = parser.parseFromString(`<!DOCTYPE html> <img src="/test-assets/c487ae/planets.jpg" width="145" height="126" alt="Planets" usemap="#planetmap" />
8+
const el = parser.parseFromString(`<!DOCTYPE html> <img src="/test-assets/c487ae/planets.jpg" width="145" height="126" alt="Planets" usemap="#planetmap" />
99
1010
<map name="planetmap">
1111
<area shape="rect" coords="0,0,30,100" href="sun.htm" alt="Sun" />
1212
</map>`, 'text/html');
1313

14-
const results = (await scan(document.body)).map(({ text, url }) => {
14+
const results = (await scan(el)).map(({ text, url }) => {
1515
return { text, url };
1616
});
1717

tests/act/tests/c487ae/2917b821f0e317de992cad191ed67aeedb9f34c9.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ const parser = new DOMParser();
55

66
describe("[c487ae]Link has non-empty accessible name", function () {
77
it("Passed Example 7 (https://act-rules.github.io/testcases/c487ae/2917b821f0e317de992cad191ed67aeedb9f34c9.html)", async () => {
8-
const document = parser.parseFromString(`<!DOCTYPE html> <a href="https://www.w3.org/WAI"
8+
const el = parser.parseFromString(`<!DOCTYPE html> <a href="https://www.w3.org/WAI"
99
><img src="/test-assets/shared/w3c-logo.png" alt="" />Web Accessibility Initiative (WAI)</a
1010
>`, 'text/html');
1111

12-
const results = (await scan(document.body)).map(({ text, url }) => {
12+
const results = (await scan(el)).map(({ text, url }) => {
1313
return { text, url };
1414
});
1515

tests/act/tests/c487ae/2bdb0351ae2e82f05cfa15198ca0a353974f6278.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ const parser = new DOMParser();
55

66
describe("[c487ae]Link has non-empty accessible name", function () {
77
it("Failed Example 7 (https://act-rules.github.io/testcases/c487ae/2bdb0351ae2e82f05cfa15198ca0a353974f6278.html)", async () => {
8-
const document = parser.parseFromString(`<!DOCTYPE html> <a href="https://www.w3.org/WAI"><img src="/test-assets/shared/w3c-logo.png" aria-labelledby="id1"/></a>`, 'text/html');
8+
const el = parser.parseFromString(`<!DOCTYPE html> <a href="https://www.w3.org/WAI"><img src="/test-assets/shared/w3c-logo.png" aria-labelledby="id1"/></a>`, 'text/html');
99

10-
const results = (await scan(document.body)).map(({ text, url }) => {
10+
const results = (await scan(el)).map(({ text, url }) => {
1111
return { text, url };
1212
});
1313

tests/act/tests/c487ae/2c58ea9a68f5bf34cabb07059af1a533be96c720.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const parser = new DOMParser();
55

66
describe("[c487ae]Link has non-empty accessible name", function () {
77
it("Passed Example 9 (https://act-rules.github.io/testcases/c487ae/2c58ea9a68f5bf34cabb07059af1a533be96c720.html)", async () => {
8-
const document = parser.parseFromString(`<!DOCTYPE html> <html>
8+
const el = parser.parseFromString(`<!DOCTYPE html> <html>
99
<style>
1010
.offScreenLink {
1111
position: absolute;
@@ -18,7 +18,7 @@ describe("[c487ae]Link has non-empty accessible name", function () {
1818
</body>
1919
</html>`, 'text/html');
2020

21-
const results = (await scan(document.body)).map(({ text, url }) => {
21+
const results = (await scan(el)).map(({ text, url }) => {
2222
return { text, url };
2323
});
2424

tests/act/tests/c487ae/34c82462f976ebaaa5f68fc0f3f519832614e182.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ const parser = new DOMParser();
55

66
describe("[c487ae]Link has non-empty accessible name", function () {
77
it("Passed Example 1 (https://act-rules.github.io/testcases/c487ae/34c82462f976ebaaa5f68fc0f3f519832614e182.html)", async () => {
8-
const document = parser.parseFromString(`<!DOCTYPE html> <a href="https://www.w3.org/WAI"> Web Accessibility Initiative (WAI) </a>`, 'text/html');
8+
const el = parser.parseFromString(`<!DOCTYPE html> <a href="https://www.w3.org/WAI"> Web Accessibility Initiative (WAI) </a>`, 'text/html');
99

10-
const results = (await scan(document.body)).map(({ text, url }) => {
10+
const results = (await scan(el)).map(({ text, url }) => {
1111
return { text, url };
1212
});
1313

tests/act/tests/c487ae/43516ed6280651bc0bb5c4fe83ba5312bca2b58b.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ const parser = new DOMParser();
55

66
describe("[c487ae]Link has non-empty accessible name", function () {
77
it("Failed Example 2 (https://act-rules.github.io/testcases/c487ae/43516ed6280651bc0bb5c4fe83ba5312bca2b58b.html)", async () => {
8-
const document = parser.parseFromString(`<!DOCTYPE html> <a href="https://www.w3.org/WAI"><img src="/test-assets/shared/w3c-logo.png" alt=""/></a>`, 'text/html');
8+
const el = parser.parseFromString(`<!DOCTYPE html> <a href="https://www.w3.org/WAI"><img src="/test-assets/shared/w3c-logo.png" alt=""/></a>`, 'text/html');
99

10-
const results = (await scan(document.body)).map(({ text, url }) => {
10+
const results = (await scan(el)).map(({ text, url }) => {
1111
return { text, url };
1212
});
1313

tests/act/tests/c487ae/51db96f8a86e965c58617540df61b15b8ba2aee3.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ const parser = new DOMParser();
55

66
describe("[c487ae]Link has non-empty accessible name", function () {
77
it("Failed Example 5 (https://act-rules.github.io/testcases/c487ae/51db96f8a86e965c58617540df61b15b8ba2aee3.html)", async () => {
8-
const document = parser.parseFromString(`<!DOCTYPE html> <a href="https://www.w3.org/WAI"><img src="/test-assets/shared/w3c-logo.png" title=""/></a>`, 'text/html');
8+
const el = parser.parseFromString(`<!DOCTYPE html> <a href="https://www.w3.org/WAI"><img src="/test-assets/shared/w3c-logo.png" title=""/></a>`, 'text/html');
99

10-
const results = (await scan(document.body)).map(({ text, url }) => {
10+
const results = (await scan(el)).map(({ text, url }) => {
1111
return { text, url };
1212
});
1313

tests/act/tests/c487ae/679a7f5c037a7080108928ea74e3792cc9818490.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ const parser = new DOMParser();
55

66
describe("[c487ae]Link has non-empty accessible name", function () {
77
it("Failed Example 3 (https://act-rules.github.io/testcases/c487ae/679a7f5c037a7080108928ea74e3792cc9818490.html)", async () => {
8-
const document = parser.parseFromString(`<!DOCTYPE html> <a href="http://www.w3.org/WAI"><img src="/test-assets/shared/w3c-logo.png" role="presentation"/></a>`, 'text/html');
8+
const el = parser.parseFromString(`<!DOCTYPE html> <a href="http://www.w3.org/WAI"><img src="/test-assets/shared/w3c-logo.png" role="presentation"/></a>`, 'text/html');
99

10-
const results = (await scan(document.body)).map(({ text, url }) => {
10+
const results = (await scan(el)).map(({ text, url }) => {
1111
return { text, url };
1212
});
1313

tests/act/tests/c487ae/7453d6a6491ddfe546eabb9f9cf1f01a96b9a805.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ const parser = new DOMParser();
55

66
describe("[c487ae]Link has non-empty accessible name", function () {
77
it("Failed Example 9 (https://act-rules.github.io/testcases/c487ae/7453d6a6491ddfe546eabb9f9cf1f01a96b9a805.html)", async () => {
8-
const document = parser.parseFromString(`<!DOCTYPE html> <img src="/test-assets/c487ae/planets.jpg" width="145" height="126" alt="Planets" usemap="#planetmap" />
8+
const el = parser.parseFromString(`<!DOCTYPE html> <img src="/test-assets/c487ae/planets.jpg" width="145" height="126" alt="Planets" usemap="#planetmap" />
99
1010
<map name="planetmap">
1111
<area shape="rect" coords="0,0,82,126" href="sun.htm" />
1212
</map>`, 'text/html');
1313

14-
const results = (await scan(document.body)).map(({ text, url }) => {
14+
const results = (await scan(el)).map(({ text, url }) => {
1515
return { text, url };
1616
});
1717

tests/act/tests/c487ae/8130b961773da8671837e6a633ca879d1edd28d0.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ const parser = new DOMParser();
55

66
describe("[c487ae]Link has non-empty accessible name", function () {
77
it("Failed Example 10 (https://act-rules.github.io/testcases/c487ae/8130b961773da8671837e6a633ca879d1edd28d0.html)", async () => {
8-
const document = parser.parseFromString(`<!DOCTYPE html> <a href="https://www.w3.org/WAI" role="none"> </a>`, 'text/html');
8+
const el = parser.parseFromString(`<!DOCTYPE html> <a href="https://www.w3.org/WAI" role="none"> </a>`, 'text/html');
99

10-
const results = (await scan(document.body)).map(({ text, url }) => {
10+
const results = (await scan(el)).map(({ text, url }) => {
1111
return { text, url };
1212
});
1313

tests/act/tests/c487ae/8b39de5e01179f2ca0b55e8aae65a18766530003.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ const parser = new DOMParser();
55

66
describe("[c487ae]Link has non-empty accessible name", function () {
77
it("Failed Example 11 (https://act-rules.github.io/testcases/c487ae/8b39de5e01179f2ca0b55e8aae65a18766530003.html)", async () => {
8-
const document = parser.parseFromString(`<!DOCTYPE html> See [<a href="https://act-rules.github.io/" role="doc-biblioref"
8+
const el = parser.parseFromString(`<!DOCTYPE html> See [<a href="https://act-rules.github.io/" role="doc-biblioref"
99
><img src="https://github.com/act-rules/act-rules.github.io/blob/develop/test-assets/shared/act-logo.png" alt=""/></a
1010
>]`, 'text/html');
1111

12-
const results = (await scan(document.body)).map(({ text, url }) => {
12+
const results = (await scan(el)).map(({ text, url }) => {
1313
return { text, url };
1414
});
1515

tests/act/tests/c487ae/9f56c77f4e790b52f176c5e2e582112af17ce658.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ const parser = new DOMParser();
55

66
describe("[c487ae]Link has non-empty accessible name", function () {
77
it("Passed Example 11 (https://act-rules.github.io/testcases/c487ae/9f56c77f4e790b52f176c5e2e582112af17ce658.html)", async () => {
8-
const document = parser.parseFromString(`<!DOCTYPE html> See [<a href="https://act-rules.github.io/" role="doc-biblioref">ACT rules</a>]`, 'text/html');
8+
const el = parser.parseFromString(`<!DOCTYPE html> See [<a href="https://act-rules.github.io/" role="doc-biblioref">ACT rules</a>]`, 'text/html');
99

10-
const results = (await scan(document.body)).map(({ text, url }) => {
10+
const results = (await scan(el)).map(({ text, url }) => {
1111
return { text, url };
1212
});
1313

tests/act/tests/c487ae/a139aa4402ef782bf321751276333b10aafd8e26.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ const parser = new DOMParser();
55

66
describe("[c487ae]Link has non-empty accessible name", function () {
77
it("Failed Example 8 (https://act-rules.github.io/testcases/c487ae/a139aa4402ef782bf321751276333b10aafd8e26.html)", async () => {
8-
const document = parser.parseFromString(`<!DOCTYPE html> <a href="https://www.w3.org/WAI" style="left: -9999px; position: absolute;">
8+
const el = parser.parseFromString(`<!DOCTYPE html> <a href="https://www.w3.org/WAI" style="left: -9999px; position: absolute;">
99
<img src="/test-assets/shared/w3c-logo.png" />
1010
</a>`, 'text/html');
1111

12-
const results = (await scan(document.body)).map(({ text, url }) => {
12+
const results = (await scan(el)).map(({ text, url }) => {
1313
return { text, url };
1414
});
1515

tests/act/tests/c487ae/a14f9d3d1d69e75cb990c1cb8951f2d70730e450.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ const parser = new DOMParser();
55

66
describe("[c487ae]Link has non-empty accessible name", function () {
77
it("Passed Example 6 (https://act-rules.github.io/testcases/c487ae/a14f9d3d1d69e75cb990c1cb8951f2d70730e450.html)", async () => {
8-
const document = parser.parseFromString(`<!DOCTYPE html> <a href="https://www.w3.org/WAI"><img src="/test-assets/shared/w3c-logo.png" title="Web Accessibility Initiative"/></a>`, 'text/html');
8+
const el = parser.parseFromString(`<!DOCTYPE html> <a href="https://www.w3.org/WAI"><img src="/test-assets/shared/w3c-logo.png" title="Web Accessibility Initiative"/></a>`, 'text/html');
99

10-
const results = (await scan(document.body)).map(({ text, url }) => {
10+
const results = (await scan(el)).map(({ text, url }) => {
1111
return { text, url };
1212
});
1313

tests/act/tests/c487ae/abce4c2053a6182bae072108d2a879caecc9c25f.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const parser = new DOMParser();
55

66
describe("[c487ae]Link has non-empty accessible name", function () {
77
it("Passed Example 2 (https://act-rules.github.io/testcases/c487ae/abce4c2053a6182bae072108d2a879caecc9c25f.html)", async () => {
8-
const document = parser.parseFromString(`<!DOCTYPE html> <div role="link" onclick="openLink(event)" onkeyup="openLink(event)" tabindex="0">
8+
const el = parser.parseFromString(`<!DOCTYPE html> <div role="link" onclick="openLink(event)" onkeyup="openLink(event)" tabindex="0">
99
Web Accessibility Initiative (WAI)
1010
</div>
1111
<script>
@@ -16,7 +16,7 @@ describe("[c487ae]Link has non-empty accessible name", function () {
1616
}
1717
</script>`, 'text/html');
1818

19-
const results = (await scan(document.body)).map(({ text, url }) => {
19+
const results = (await scan(el)).map(({ text, url }) => {
2020
return { text, url };
2121
});
2222

tests/act/tests/c487ae/c94621492b6195e264171aa7132198c46cfdf12b.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ const parser = new DOMParser();
55

66
describe("[c487ae]Link has non-empty accessible name", function () {
77
it("Passed Example 3 (https://act-rules.github.io/testcases/c487ae/c94621492b6195e264171aa7132198c46cfdf12b.html)", async () => {
8-
const document = parser.parseFromString(`<!DOCTYPE html> <button role="link" onclick="window.location.href='https://www.w3.org/WAI/'">Click me for WAI!</button>`, 'text/html');
8+
const el = parser.parseFromString(`<!DOCTYPE html> <button role="link" onclick="window.location.href='https://www.w3.org/WAI/'">Click me for WAI!</button>`, 'text/html');
99

10-
const results = (await scan(document.body)).map(({ text, url }) => {
10+
const results = (await scan(el)).map(({ text, url }) => {
1111
return { text, url };
1212
});
1313

tests/act/tests/c487ae/d2e2cc0d8464668b150ed39373c350e5c35f59d2.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ const parser = new DOMParser();
55

66
describe("[c487ae]Link has non-empty accessible name", function () {
77
it("Failed Example 4 (https://act-rules.github.io/testcases/c487ae/d2e2cc0d8464668b150ed39373c350e5c35f59d2.html)", async () => {
8-
const document = parser.parseFromString(`<!DOCTYPE html> <a href="http://www.w3.org/WAI"><img src="/test-assets/shared/w3c-logo.png" role="none"/></a>`, 'text/html');
8+
const el = parser.parseFromString(`<!DOCTYPE html> <a href="http://www.w3.org/WAI"><img src="/test-assets/shared/w3c-logo.png" role="none"/></a>`, 'text/html');
99

10-
const results = (await scan(document.body)).map(({ text, url }) => {
10+
const results = (await scan(el)).map(({ text, url }) => {
1111
return { text, url };
1212
});
1313

tests/act/tests/c487ae/e1c9b4f7702d04de31ba52d5af5c63dd6863804a.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ const parser = new DOMParser();
55

66
describe("[c487ae]Link has non-empty accessible name", function () {
77
it("Failed Example 6 (https://act-rules.github.io/testcases/c487ae/e1c9b4f7702d04de31ba52d5af5c63dd6863804a.html)", async () => {
8-
const document = parser.parseFromString(`<!DOCTYPE html> <a href="https://www.w3.org/WAI"><img src="/test-assets/shared/w3c-logo.png" aria-labelledby="id1"/></a>
8+
const el = parser.parseFromString(`<!DOCTYPE html> <a href="https://www.w3.org/WAI"><img src="/test-assets/shared/w3c-logo.png" aria-labelledby="id1"/></a>
99
<div id="id1"></div>`, 'text/html');
1010

11-
const results = (await scan(document.body)).map(({ text, url }) => {
11+
const results = (await scan(el)).map(({ text, url }) => {
1212
return { text, url };
1313
});
1414

tests/act/tests/de46e4/2c6ce29c2934936b9dd032e87695bffae9bc514e.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ const parser = new DOMParser();
55

66
describe("[de46e4]Element with lang attribute has valid language tag", function () {
77
it("Passed Example 3 (https://act-rules.github.io/testcases/de46e4/2c6ce29c2934936b9dd032e87695bffae9bc514e.html)", async () => {
8-
const document = parser.parseFromString(`<!DOCTYPE html> <html>
8+
const el = parser.parseFromString(`<!DOCTYPE html> <html>
99
<body>
1010
<p lang="en-US-GB">
1111
They wandered into a strange Tiki bar on the edge of the small beach town.
1212
</p>
1313
</body>
1414
</html>`, 'text/html');
1515

16-
const results = (await scan(document.body)).map(({ text, url }) => {
16+
const results = (await scan(el)).map(({ text, url }) => {
1717
return { text, url };
1818
});
1919

tests/act/tests/de46e4/3bc716b9f3d4789c4a6aea4787d273b72a41d153.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ const parser = new DOMParser();
55

66
describe("[de46e4]Element with lang attribute has valid language tag", function () {
77
it("Passed Example 5 (https://act-rules.github.io/testcases/de46e4/3bc716b9f3d4789c4a6aea4787d273b72a41d153.html)", async () => {
8-
const document = parser.parseFromString(`<!DOCTYPE html> <html>
8+
const el = parser.parseFromString(`<!DOCTYPE html> <html>
99
<body>
1010
<div lang="EN">
1111
<img src="/test-assets/shared/fireworks.jpg" alt="Fireworks over Paris" />
1212
</div>
1313
</body>
1414
</html>`, 'text/html');
1515

16-
const results = (await scan(document.body)).map(({ text, url }) => {
16+
const results = (await scan(el)).map(({ text, url }) => {
1717
return { text, url };
1818
});
1919

0 commit comments

Comments
 (0)