testaro 8.1.17 → 8.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "testaro",
3
- "version": "8.1.17",
3
+ "version": "8.2.0",
4
4
  "description": "Automation of accessibility testing",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/tests/docType.js CHANGED
@@ -1,12 +1,14 @@
1
1
  /*
2
2
  docType
3
3
  Derived from the bbc-a11y allDocumentsMustHaveAW3cRecommendedDoctype test.
4
- This test reports a failure to equip the page document with a W3C-recommended doctype.
4
+ This test reports a failure to equip the page document with a W3C-recommended HTML doctype.
5
5
  */
6
6
  exports.reporter = async page => {
7
7
  // Identify the visible links without href attributes.
8
- const docType = await page.evaluate(() => document.doctype);
9
- return {result: {
10
- docHasType: Boolean(docType)
11
- }};
8
+ const docHasType = await page.evaluate(() => {
9
+ const docType = document.doctype;
10
+ const docHasType = !! docType && docType.name && docType.name.toLowerCase() === 'html';
11
+ return docHasType;
12
+ });
13
+ return {result: {docHasType}};
12
14
  };
@@ -1,4 +1,4 @@
1
- <!DOCTYPE html>
1
+ <!docType Html>
2
2
  <html lang="en-US">
3
3
  <head>
4
4
  <meta charset="utf-8">
@@ -9,7 +9,7 @@
9
9
  <body>
10
10
  <main>
11
11
  <h1>Page with doctype</h1>
12
- <p>This page has a doctype.</p>
12
+ <p>This page has a doctype. Because the entire tag is case-insensitive, this instance has mixed case, which should be treated as conformant.</p>
13
13
  </main>
14
14
  </body>
15
15
  </html>