-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(modal): add a11y; visual tests (#1531)
* test(modal): add a11y; visual tests * Set reduceMotion on playwrightLaunchers * Update modal baseline images * Update non-modal baseline images 🤷♂️ * Revert "Update non-modal baseline images 🤷♂️" This reverts commit cad9ff2. * Update baseline modal images
- Loading branch information
1 parent
abac770
commit 330a123
Showing
100 changed files
with
395 additions
and
6 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { html } from "@open-wc/testing"; | ||
import { runComponentTests } from "../../test/test-utils"; | ||
import { IconClearSm } from "@stackoverflow/stacks-icons/icons"; | ||
import "../../index"; | ||
|
||
describe("modal", () => { | ||
runComponentTests({ | ||
type: "a11y", | ||
baseClass: `s-modal`, | ||
variants: ["danger"], | ||
modifiers: { | ||
primary: ["celebration"], | ||
secondary: ["full"], | ||
}, | ||
children: { | ||
default: ` | ||
<div class="s-modal--dialog" role="document"> | ||
<h1 class="s-modal--header" id="modal-title">Modal header</h1> | ||
<p class="s-modal--body" id="modal-description">Modal body. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam.</p> | ||
<div class="d-flex gx8 s-modal--footer"> | ||
<button class="s-btn s-btn__filled" type="button">Confirm</button> | ||
<button class="s-btn s-btn__muted" type="button">Cancel</button> | ||
</div> | ||
<button class="s-modal--close s-btn s-btn__muted" type="button" aria-label="Close"> | ||
${IconClearSm} | ||
</button> | ||
</div> | ||
`, | ||
}, | ||
tag: "aside", | ||
attributes: { | ||
"id": "example-modal", | ||
"tabindex": "-1", | ||
"aria-hidden": "false", | ||
"aria-labelledby": "modal-title", | ||
"class": "ps-relative p32", | ||
}, | ||
template: ({ component, testid }) => html` | ||
<div class="m8 ws6" data-testid="${testid}">${component}</div> | ||
`, | ||
}); | ||
}); |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { html } from "@open-wc/testing"; | ||
import { runComponentTests } from "../../test/test-utils"; | ||
import { IconClearSm } from "@stackoverflow/stacks-icons/icons"; | ||
import "../../index"; | ||
|
||
describe("modal", () => { | ||
runComponentTests({ | ||
type: "visual", | ||
baseClass: `s-modal`, | ||
variants: ["danger"], | ||
modifiers: { | ||
primary: ["celebration"], | ||
secondary: ["full"], | ||
}, | ||
children: { | ||
default: ` | ||
<div class="s-modal--dialog" role="document"> | ||
<h1 class="s-modal--header" id="modal-title">Modal header</h1> | ||
<p class="s-modal--body" id="modal-description">Modal body. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam.</p> | ||
<div class="d-flex gx8 s-modal--footer"> | ||
<button class="s-btn s-btn__filled" type="button">Confirm</button> | ||
<button class="s-btn s-btn__muted" type="button">Cancel</button> | ||
</div> | ||
<button class="s-modal--close s-btn s-btn__muted" type="button" aria-label="Close"> | ||
${IconClearSm} | ||
</button> | ||
</div> | ||
`, | ||
}, | ||
tag: "aside", | ||
attributes: { | ||
"id": "example-modal", | ||
"tabindex": "-1", | ||
"aria-hidden": "false", | ||
"aria-labelledby": "modal-title", | ||
"class": "ps-relative p32", | ||
}, | ||
template: ({ component, testid }) => html` | ||
<div class="m8 ws6" data-testid="${testid}">${component}</div> | ||
`, | ||
}); | ||
}); |
3 changes: 3 additions & 0 deletions
3
screenshots/Chromium/baseline/s-modal-dark-celebration-full.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
screenshots/Chromium/baseline/s-modal-dark-danger-celebration-full.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
screenshots/Chromium/baseline/s-modal-dark-danger-celebration.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
screenshots/Chromium/baseline/s-modal-highcontrast-dark-celebration-full.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
screenshots/Chromium/baseline/s-modal-highcontrast-dark-celebration.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
...enshots/Chromium/baseline/s-modal-highcontrast-dark-danger-celebration-full.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
screenshots/Chromium/baseline/s-modal-highcontrast-dark-danger-celebration.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
screenshots/Chromium/baseline/s-modal-highcontrast-dark-danger-full.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
screenshots/Chromium/baseline/s-modal-highcontrast-dark-danger.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
screenshots/Chromium/baseline/s-modal-highcontrast-dark-full.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
screenshots/Chromium/baseline/s-modal-highcontrast-light-celebration-full.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
screenshots/Chromium/baseline/s-modal-highcontrast-light-celebration.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
...nshots/Chromium/baseline/s-modal-highcontrast-light-danger-celebration-full.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
screenshots/Chromium/baseline/s-modal-highcontrast-light-danger-celebration.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
screenshots/Chromium/baseline/s-modal-highcontrast-light-danger-full.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
screenshots/Chromium/baseline/s-modal-highcontrast-light-danger.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
screenshots/Chromium/baseline/s-modal-highcontrast-light-full.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
screenshots/Chromium/baseline/s-modal-light-celebration-full.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
3 changes: 3 additions & 0 deletions
3
screenshots/Chromium/baseline/s-modal-light-danger-celebration-full.png
Oops, something went wrong.
3 changes: 3 additions & 0 deletions
3
screenshots/Chromium/baseline/s-modal-light-danger-celebration.png
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
3 changes: 3 additions & 0 deletions
3
screenshots/Firefox/baseline/s-modal-dark-celebration-full.png
Oops, something went wrong.
Oops, something went wrong.
3 changes: 3 additions & 0 deletions
3
screenshots/Firefox/baseline/s-modal-dark-danger-celebration-full.png
Oops, something went wrong.
3 changes: 3 additions & 0 deletions
3
screenshots/Firefox/baseline/s-modal-dark-danger-celebration.png
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
3 changes: 3 additions & 0 deletions
3
screenshots/Firefox/baseline/s-modal-highcontrast-dark-celebration-full.png
Oops, something went wrong.
3 changes: 3 additions & 0 deletions
3
screenshots/Firefox/baseline/s-modal-highcontrast-dark-celebration.png
Oops, something went wrong.
3 changes: 3 additions & 0 deletions
3
screenshots/Firefox/baseline/s-modal-highcontrast-dark-danger-celebration-full.png
Oops, something went wrong.
3 changes: 3 additions & 0 deletions
3
screenshots/Firefox/baseline/s-modal-highcontrast-dark-danger-celebration.png
Oops, something went wrong.
3 changes: 3 additions & 0 deletions
3
screenshots/Firefox/baseline/s-modal-highcontrast-dark-danger-full.png
Oops, something went wrong.
3 changes: 3 additions & 0 deletions
3
screenshots/Firefox/baseline/s-modal-highcontrast-dark-danger.png
Oops, something went wrong.
3 changes: 3 additions & 0 deletions
3
screenshots/Firefox/baseline/s-modal-highcontrast-dark-full.png
Oops, something went wrong.
Oops, something went wrong.
3 changes: 3 additions & 0 deletions
3
screenshots/Firefox/baseline/s-modal-highcontrast-light-celebration-full.png
Oops, something went wrong.
3 changes: 3 additions & 0 deletions
3
screenshots/Firefox/baseline/s-modal-highcontrast-light-celebration.png
Oops, something went wrong.
3 changes: 3 additions & 0 deletions
3
...enshots/Firefox/baseline/s-modal-highcontrast-light-danger-celebration-full.png
Oops, something went wrong.
3 changes: 3 additions & 0 deletions
3
screenshots/Firefox/baseline/s-modal-highcontrast-light-danger-celebration.png
Oops, something went wrong.
3 changes: 3 additions & 0 deletions
3
screenshots/Firefox/baseline/s-modal-highcontrast-light-danger-full.png
Oops, something went wrong.
3 changes: 3 additions & 0 deletions
3
screenshots/Firefox/baseline/s-modal-highcontrast-light-danger.png
Oops, something went wrong.
3 changes: 3 additions & 0 deletions
3
screenshots/Firefox/baseline/s-modal-highcontrast-light-full.png
Oops, something went wrong.
Oops, something went wrong.
3 changes: 3 additions & 0 deletions
3
screenshots/Firefox/baseline/s-modal-light-celebration-full.png
Oops, something went wrong.
Oops, something went wrong.
3 changes: 3 additions & 0 deletions
3
screenshots/Firefox/baseline/s-modal-light-danger-celebration-full.png
Oops, something went wrong.
3 changes: 3 additions & 0 deletions
3
screenshots/Firefox/baseline/s-modal-light-danger-celebration.png
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
3 changes: 3 additions & 0 deletions
3
screenshots/Webkit/baseline/s-modal-dark-celebration-full.png
Oops, something went wrong.
Oops, something went wrong.
3 changes: 3 additions & 0 deletions
3
screenshots/Webkit/baseline/s-modal-dark-danger-celebration-full.png
Oops, something went wrong.
3 changes: 3 additions & 0 deletions
3
screenshots/Webkit/baseline/s-modal-dark-danger-celebration.png
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.