Skip to content

Commit

Permalink
test(button): e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alisonailea committed Jan 10, 2025
1 parent 79b3c77 commit a989f02
Showing 1 changed file with 56 additions and 1 deletion.
57 changes: 56 additions & 1 deletion packages/calcite-components/src/components/button/button.e2e.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// @ts-strict-ignore
import { newE2EPage, E2EElement } from "@arcgis/lumina-compiler/puppeteerTesting";
import { describe, expect, it } from "vitest";
import { accessible, defaults, disabled, hidden, HYDRATED_ATTR, labelable, t9n } from "../../tests/commonTests";
import { accessible, defaults, disabled, hidden, HYDRATED_ATTR, labelable, t9n, themed } from "../../tests/commonTests";
import { GlobalTestProps } from "../../tests/utils";
import { html } from "../../../support/formatting";
import { CSS } from "./resources";
Expand Down Expand Up @@ -713,4 +713,59 @@ describe("calcite-button", () => {
expect(elementHost).toEqualAttribute("width", "full");
expect(await elementAsButton.getComputedStyle()["width"]).toEqual(await elementHost.getComputedStyle()["width"]);
});

describe("theme", () => {
describe("default", () => {
themed("calcite-button", {
"--calcite-button-background-color": {
shadowSelector: "button",
targetProp: "backgroundColor",
},
"--calcite-button-corner-radius": {
shadowSelector: "button",
targetProp: "borderRadius",
},
"--calcite-button-text-color": {
shadowSelector: "button",
targetProp: "color",
},
"--calcite-button-border-color": {
shadowSelector: "button",
targetProp: "borderColor",
},
});
});
describe("loading", () => {
themed(html`<calcite-button loading></calcite-button>`, {
"--calcite-button-background-color": {
shadowSelector: "button",
targetProp: "backgroundColor",
},
"--calcite-button-corner-radius": {
shadowSelector: "button",
targetProp: "borderRadius",
},
"--calcite-button-text-color": {
shadowSelector: "button",
targetProp: "color",
},
"--calcite-button-loader-color": {
shadowSelector: `.${CSS.loadingIn}`,
targetProp: "color",
},
"--calcite-button-border-color": {
shadowSelector: "button",
targetProp: "borderColor",
},
});
});
describe("outline", () => {
themed(html`<calcite-button appearance="outline"></calcite-button>`, {
"--calcite-button-border-color": {
shadowSelector: "button",
targetProp: "borderColor",
},
});
});
});
});

0 comments on commit a989f02

Please sign in to comment.