Skip to content

Commit

Permalink
test(empty-state): add a11y; visual tests (#1518)
Browse files Browse the repository at this point in the history
* test(empty-state): add a11y; visual tests

* Generate missing baseline visual regression images
  • Loading branch information
dancormier authored Oct 17, 2023
1 parent 5d76484 commit 240418e
Show file tree
Hide file tree
Showing 14 changed files with 70 additions and 0 deletions.
17 changes: 17 additions & 0 deletions lib/components/empty-state/empty-state.a11y.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { html } from "@open-wc/testing";
import { SpotEmptyXL } from "@stackoverflow/stacks-icons";
import { runComponentTests } from "../../test/test-utils";
import "../../index";

describe("empty-state", () => {
runComponentTests({
type: "a11y",
baseClass: "s-empty-state",
children: {
default: `${SpotEmptyXL}<p class="mt24"><strong>Hello!</strong> This is a wonderful empty state component.</p>`,
},
template: ({ component, testid }) => html`
<div class="ws3 p16" data-testid="${testid}">${component}</div>
`,
});
});
17 changes: 17 additions & 0 deletions lib/components/empty-state/empty-state.visual.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { html } from "@open-wc/testing";
import { SpotEmptyXL } from "@stackoverflow/stacks-icons";
import { runComponentTests } from "../../test/test-utils";
import "../../index";

describe("empty-state", () => {
runComponentTests({
type: "visual",
baseClass: "s-empty-state",
children: {
default: `${SpotEmptyXL}<p class="mt24"><strong>Hello!</strong> This is a wonderful empty state component.</p>`,
},
template: ({ component, testid }) => html`
<div class="ws3 p16" data-testid="${testid}">${component}</div>
`,
});
});
3 changes: 3 additions & 0 deletions screenshots/Chromium/baseline/s-empty-state-dark.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.
3 changes: 3 additions & 0 deletions screenshots/Chromium/baseline/s-empty-state-light.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 screenshots/Firefox/baseline/s-empty-state-dark.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.
3 changes: 3 additions & 0 deletions screenshots/Firefox/baseline/s-empty-state-light.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 screenshots/Webkit/baseline/s-empty-state-dark.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.
3 changes: 3 additions & 0 deletions screenshots/Webkit/baseline/s-empty-state-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 240418e

Please sign in to comment.