From a989f02054b3e774f5fc12addf154fa08f86d36f Mon Sep 17 00:00:00 2001 From: Ali Stump Date: Fri, 10 Jan 2025 00:04:16 -0800 Subject: [PATCH] test(button): e2e tests --- .../src/components/button/button.e2e.ts | 57 ++++++++++++++++++- 1 file changed, 56 insertions(+), 1 deletion(-) diff --git a/packages/calcite-components/src/components/button/button.e2e.ts b/packages/calcite-components/src/components/button/button.e2e.ts index b732aa8aae5..5aa148117ff 100644 --- a/packages/calcite-components/src/components/button/button.e2e.ts +++ b/packages/calcite-components/src/components/button/button.e2e.ts @@ -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"; @@ -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-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-border-color": { + shadowSelector: "button", + targetProp: "borderColor", + }, + }); + }); + }); });