From 3f54186c0dcf0706e65fd80bc75e39f7539aec8b Mon Sep 17 00:00:00 2001 From: Goutham Ponnada Date: Wed, 9 Oct 2024 15:35:00 -0700 Subject: [PATCH] fix: tests, updated axe rules --- .../focus-order-semantics.expected/index.md | 9 - .../html/focus-order-semantics/index.marko | 1 - .../src/service/html/axe-rules/axe-rules.ts | 197 ++++++++++-------- .../html/axe-rules/generate-axe-rules.ts | 11 +- .../service/html/axe-rules/rule-exceptions.ts | 7 +- 5 files changed, 123 insertions(+), 102 deletions(-) delete mode 100644 packages/language-server/src/__tests__/fixtures/html/focus-order-semantics/__snapshots__/focus-order-semantics.expected/index.md delete mode 100644 packages/language-server/src/__tests__/fixtures/html/focus-order-semantics/index.marko diff --git a/packages/language-server/src/__tests__/fixtures/html/focus-order-semantics/__snapshots__/focus-order-semantics.expected/index.md b/packages/language-server/src/__tests__/fixtures/html/focus-order-semantics/__snapshots__/focus-order-semantics.expected/index.md deleted file mode 100644 index 0b96ad24..00000000 --- a/packages/language-server/src/__tests__/fixtures/html/focus-order-semantics/__snapshots__/focus-order-semantics.expected/index.md +++ /dev/null @@ -1,9 +0,0 @@ -## Diagnostics -### Ln 1, Col 2 -```marko -> 1 |
This is a div, but it is focusable
- | ^^^ Fix any of the following: - Element does not have a widget role. - Element has invalid semantics for an element in the focus order. -``` - diff --git a/packages/language-server/src/__tests__/fixtures/html/focus-order-semantics/index.marko b/packages/language-server/src/__tests__/fixtures/html/focus-order-semantics/index.marko deleted file mode 100644 index 07a7a241..00000000 --- a/packages/language-server/src/__tests__/fixtures/html/focus-order-semantics/index.marko +++ /dev/null @@ -1 +0,0 @@ -
This is a div, but it is focusable
\ No newline at end of file diff --git a/packages/language-server/src/service/html/axe-rules/axe-rules.ts b/packages/language-server/src/service/html/axe-rules/axe-rules.ts index 5be61e04..62a932bf 100644 --- a/packages/language-server/src/service/html/axe-rules/axe-rules.ts +++ b/packages/language-server/src/service/html/axe-rules/axe-rules.ts @@ -1,31 +1,31 @@ export const keyboard = { /** - * - Ensures every accesskey attribute value is unique + * - Ensure every accesskey attribute value is unique * - accesskey attribute value should be unique ([url](https://dequeuniversity.com/rules/axe/4.10/accesskeys?application=axeAPI)) */ accesskeys: "accesskeys", /** - * - Ensures each page has at least one mechanism for a user to bypass navigation and jump straight to the content + * - Ensure each page has at least one mechanism for a user to bypass navigation and jump straight to the content * - Page must have means to bypass repeated blocks ([url](https://dequeuniversity.com/rules/axe/4.10/bypass?application=axeAPI)) */ bypass: "bypass", /** - * - Ensures elements in the focus order have a role appropriate for interactive content + * - Ensure elements in the focus order have a role appropriate for interactive content * - Elements in the focus order should have an appropriate role ([url](https://dequeuniversity.com/rules/axe/4.10/focus-order-semantics?application=axeAPI)) */ focusOrderSemantics: "focus-order-semantics", /** - * - Ensures `` and `