|
1 | 1 | // @ts-strict-ignore
|
2 | 2 | import { newE2EPage, E2EElement } from "@arcgis/lumina-compiler/puppeteerTesting";
|
3 | 3 | import { describe, expect, it } from "vitest";
|
4 |
| -import { accessible, defaults, disabled, hidden, HYDRATED_ATTR, labelable, t9n } from "../../tests/commonTests"; |
| 4 | +import { accessible, defaults, disabled, hidden, HYDRATED_ATTR, labelable, t9n, themed } from "../../tests/commonTests"; |
5 | 5 | import { GlobalTestProps } from "../../tests/utils";
|
6 | 6 | import { html } from "../../../support/formatting";
|
7 | 7 | import { CSS } from "./resources";
|
@@ -713,4 +713,59 @@ describe("calcite-button", () => {
|
713 | 713 | expect(elementHost).toEqualAttribute("width", "full");
|
714 | 714 | expect(await elementAsButton.getComputedStyle()["width"]).toEqual(await elementHost.getComputedStyle()["width"]);
|
715 | 715 | });
|
| 716 | + |
| 717 | + describe("theme", () => { |
| 718 | + describe("default", () => { |
| 719 | + themed("calcite-button", { |
| 720 | + "--calcite-button-background-color": { |
| 721 | + shadowSelector: "button", |
| 722 | + targetProp: "backgroundColor", |
| 723 | + }, |
| 724 | + "--calcite-button-corner-radius": { |
| 725 | + shadowSelector: "button", |
| 726 | + targetProp: "borderRadius", |
| 727 | + }, |
| 728 | + "--calcite-button-text-color": { |
| 729 | + shadowSelector: "button", |
| 730 | + targetProp: "color", |
| 731 | + }, |
| 732 | + "--calcite-button-border-color": { |
| 733 | + shadowSelector: "button", |
| 734 | + targetProp: "borderColor", |
| 735 | + }, |
| 736 | + }); |
| 737 | + }); |
| 738 | + describe("loading", () => { |
| 739 | + themed(html`<calcite-button loading></calcite-button>`, { |
| 740 | + "--calcite-button-background-color": { |
| 741 | + shadowSelector: "button", |
| 742 | + targetProp: "backgroundColor", |
| 743 | + }, |
| 744 | + "--calcite-button-corner-radius": { |
| 745 | + shadowSelector: "button", |
| 746 | + targetProp: "borderRadius", |
| 747 | + }, |
| 748 | + "--calcite-button-text-color": { |
| 749 | + shadowSelector: "button", |
| 750 | + targetProp: "color", |
| 751 | + }, |
| 752 | + "--calcite-button-loader-color": { |
| 753 | + shadowSelector: `.${CSS.loadingIn}`, |
| 754 | + targetProp: "color", |
| 755 | + }, |
| 756 | + "--calcite-button-border-color": { |
| 757 | + shadowSelector: "button", |
| 758 | + targetProp: "borderColor", |
| 759 | + }, |
| 760 | + }); |
| 761 | + }); |
| 762 | + describe("outline", () => { |
| 763 | + themed(html`<calcite-button appearance="outline"></calcite-button>`, { |
| 764 | + "--calcite-button-border-color": { |
| 765 | + shadowSelector: "button", |
| 766 | + targetProp: "borderColor", |
| 767 | + }, |
| 768 | + }); |
| 769 | + }); |
| 770 | + }); |
716 | 771 | });
|
0 commit comments