|
1 | 1 | import { E2EPage, newE2EPage } from "@stencil/core/testing";
|
2 |
| -import { defaults, hidden, reflects, renders, t9n } from "../../tests/commonTests"; |
| 2 | +import { defaults, hidden, reflects, renders, t9n, themed } from "../../tests/commonTests"; |
3 | 3 | import { html } from "../../../support/formatting";
|
4 | 4 | import { NumberStringFormatOptions } from "../../utils/locale";
|
5 | 5 | import { isElementFocused } from "../../tests/utils";
|
| 6 | +import { ComponentTestTokens } from "../../tests/commonTests/themed"; |
| 7 | +import { CSS } from "./resources"; |
6 | 8 |
|
7 | 9 | // we use browser-context function to click on items to workaround `E2EElement#click` error
|
8 | 10 | async function itemClicker(item: HTMLCalciteStepperItemElement) {
|
@@ -899,4 +901,74 @@ describe("calcite-stepper", () => {
|
899 | 901 | expect(displayedItems.length).toBe(1);
|
900 | 902 | });
|
901 | 903 | });
|
| 904 | + |
| 905 | + describe("theme", () => { |
| 906 | + describe("default", () => { |
| 907 | + const tokens: ComponentTestTokens = { |
| 908 | + "--calcite-stepper-action-background-color": { |
| 909 | + shadowSelector: `calcite-action`, |
| 910 | + targetProp: "--calcite-action-background-color", |
| 911 | + }, |
| 912 | + "--calcite-stepper-action-background-color-hover": { |
| 913 | + shadowSelector: `calcite-action`, |
| 914 | + targetProp: "--calcite-action-background-color", |
| 915 | + state: { hover: { attribute: "class", value: CSS.actionIcon } }, |
| 916 | + }, |
| 917 | + "--calcite-stepper-action-background-color-active": { |
| 918 | + shadowSelector: `calcite-action`, |
| 919 | + targetProp: "--calcite-action-background-color", |
| 920 | + state: { press: { attribute: "class", value: CSS.actionIcon } }, |
| 921 | + }, |
| 922 | + "--calcite-stepper-step-bar-fill-color": { |
| 923 | + shadowSelector: `.${CSS.stepBar} ${CSS.rect}`, |
| 924 | + targetProp: "fill", |
| 925 | + }, |
| 926 | + "--calcite-stepper-step-bar-fill-color-hover": { |
| 927 | + shadowSelector: `.${CSS.stepBar} ${CSS.rect}`, |
| 928 | + targetProp: "fill", |
| 929 | + state: "hover", |
| 930 | + }, |
| 931 | + "--calcite-stepper-step-bar-selected-fill-color": { |
| 932 | + shadowSelector: `.${CSS.stepBarSelected}`, |
| 933 | + targetProp: "fill", |
| 934 | + }, |
| 935 | + "--calcite-stepper-step-bar-complete-fill-color": { |
| 936 | + shadowSelector: `.${CSS.stepBarComplete}`, |
| 937 | + targetProp: "fill", |
| 938 | + }, |
| 939 | + "--calcite-stepper-step-bar-completed-fill-color-hover": { |
| 940 | + shadowSelector: `.${CSS.stepBarComplete}`, |
| 941 | + targetProp: "fill", |
| 942 | + state: "hover", |
| 943 | + }, |
| 944 | + "--calcite-stepper-step-bar-error-fill-color": { |
| 945 | + shadowSelector: `.${CSS.stepBarError}`, |
| 946 | + targetProp: "fill", |
| 947 | + }, |
| 948 | + "--calcite-stepper-step-bar-error-fill-color-hover": { |
| 949 | + shadowSelector: `.${CSS.stepBarError}`, |
| 950 | + targetProp: "fill", |
| 951 | + }, |
| 952 | + }; |
| 953 | + themed( |
| 954 | + html` |
| 955 | + <calcite-stepper layout="horizontal-single" numbered icon scale="s"> |
| 956 | + <calcite-stepper-item heading="Confirm and complete"> |
| 957 | + <div>Step 4 Content Goes Here</div> |
| 958 | + </calcite-stepper-item> |
| 959 | + <calcite-stepper-item heading="Choose method" selected> |
| 960 | + <div>Step 1 Content Goes Here</div> |
| 961 | + </calcite-stepper-item> |
| 962 | + <calcite-stepper-item heading="Compile member list" complete> |
| 963 | + <div>Step 2 Content Goes Here</div> |
| 964 | + </calcite-stepper-item> |
| 965 | + <calcite-stepper-item heading="Set member properties" description="Some subtext" error> |
| 966 | + <div>Step 3 Content Goes Here</div> |
| 967 | + </calcite-stepper-item> |
| 968 | + </calcite-stepper> |
| 969 | + `, |
| 970 | + tokens, |
| 971 | + ); |
| 972 | + }); |
| 973 | + }); |
902 | 974 | });
|
0 commit comments