feat: Add allColorModes option to axe tests#978
Merged
Conversation
GZolla
commented
May 7, 2026
Comment on lines
+62
to
+141
| const HTML_BODY = testFramework => ` | ||
| <body> | ||
| ${TEST_PAGE} | ||
| ${SUPPRESS_RESIZE_OBSERVER_ERRORS} | ||
| <script type="module" src="${testFramework}"></script> | ||
| </body> | ||
| `; | ||
| const HTML_HEAD = ` | ||
| <head> | ||
| <link rel="preload" href="${FONT_ASSETS}Lato-400.woff2" as="font" type="font/woff2" crossorigin> | ||
| <link rel="preload" href="${FONT_ASSETS}Lato-700.woff2" as="font" type="font/woff2" crossorigin> | ||
| <style> | ||
|
|
||
| html { | ||
| --d2l-cursor-resize-inline-end: e-resize; | ||
| --d2l-cursor-resize-inline-start: w-resize; | ||
| --d2l-document-direction: ltr; | ||
| --d2l-inline-end: right; | ||
| --d2l-inline-start: left; | ||
| --d2l-length-factor: 1; | ||
| --d2l-mirror-transform: none; | ||
| --d2l-theme-background-color-base: #ffffff; | ||
| --d2l-theme-text-color-static-standard: #202122; | ||
| font-size: 20px; | ||
| } | ||
|
|
||
| html[dir="rtl"] * { | ||
| --d2l-cursor-resize-inline-end: w-resize; | ||
| --d2l-cursor-resize-inline-start: e-resize; | ||
| --d2l-document-direction: rtl; | ||
| --d2l-inline-end: left; | ||
| --d2l-inline-start: right; | ||
| --d2l-length-factor: -1; | ||
| --d2l-mirror-transform: scale(-1, 1); | ||
| } | ||
|
|
||
| html[data-color-mode="dark"] { | ||
| --d2l-theme-background-color-base: #161718; | ||
| --d2l-theme-text-color-static-standard: #cdd5dc; | ||
| } | ||
|
|
||
| @font-face { | ||
| font-family: 'Lato'; | ||
| font-style: normal; | ||
| font-weight: 400; | ||
| src: url(${FONT_ASSETS}Lato-400.woff2) format('woff2'); | ||
| } | ||
| @font-face { | ||
| font-family: 'Lato'; | ||
| font-style: normal; | ||
| font-weight: 700; | ||
| src: url(${FONT_ASSETS}Lato-700.woff2) format('woff2'); | ||
| } | ||
|
|
||
| body { | ||
| background-color: var(--d2l-theme-background-color-base); | ||
| color: var(--d2l-theme-text-color-static-standard); | ||
| font-family: 'Lato', sans-serif; | ||
| letter-spacing: 0.01rem; | ||
| font-size: 0.95rem; | ||
| font-weight: 400; | ||
| line-height: 1.4rem; | ||
| margin: 0; | ||
| padding: 38px; | ||
| } | ||
| body.no-padding { | ||
| padding: 0; | ||
| } | ||
| </style> | ||
| </head> | ||
| `; | ||
| const DEFAULT_TEST_RUNNER_HTML = testFramework => `<!DOCTYPE html> | ||
| <html lang="en" data-timezone='${TIMEZONE}'> | ||
| ${HTML_BODY(testFramework)} | ||
| </html>`; | ||
| const FULL_TEST_RUNNER_HTML = testFramework => `<!DOCTYPE html> | ||
| <html lang="en" data-timezone='${TIMEZONE}'> | ||
| ${HTML_HEAD} | ||
| ${HTML_BODY(testFramework)} | ||
| </html>`; |
Contributor
Author
There was a problem hiding this comment.
Make HTML reusable to set it for axe tests
GZolla
commented
May 7, 2026
Comment on lines
-180
to
-184
| if (filter) { | ||
| config.groups.forEach(group => { | ||
| group.files = this.#filterFiles([ group.files ].flat()); | ||
| }); | ||
| } |
Contributor
Author
There was a problem hiding this comment.
I may be missing something but this.#pattern already sets .files to a filtered set of wildcards, doing it again here breaks those wildcards(e.g. axe --filter card was resulting in **/test/+(+(card.axe.js)) which was not matching any files.
Member
There was a problem hiding this comment.
I think I ran into this bug the other day -- makes sense!
|
🎉 This PR is included in version 1.43.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GAUD-9876