Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(select): add component token E2E tests #9593

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions packages/calcite-components/src/components/select/select.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
labelable,
reflects,
renders,
themed,
} from "../../tests/commonTests";
import { html } from "../../../support/formatting";
import { CSS } from "./resources";
Expand Down Expand Up @@ -434,4 +435,46 @@ describe("calcite-select", () => {
},
);
});

describe("theme", () => {
describe("default", () => {
themed("calcite-select", {
"--calcite-select-background-color": {
shadowSelector: `.${CSS.select}`,
targetProp: "backgroundColor",
},
"--calcite-select-border-color": [
{
shadowSelector: `.${CSS.select}`,
targetProp: "borderColor",
},
{
shadowSelector: `.${CSS.iconContainer}`,
targetProp: "borderColor",
},
],
"--calcite-select-text-color": {
shadowSelector: `.${CSS.select}`,
targetProp: "color",
},
"--calcite-select-icon-color": {
shadowSelector: `.${CSS.icon}`,
targetProp: "--calcite-icon-color",
},
});
});

describe("deprecated", () => {
themed("calcite-select", {
"--calcite-select-font-size": {
shadowSelector: `.${CSS.select}`,
targetProp: "fontSize",
},
"--calcite-select-spacing": {
shadowSelector: `.${CSS.select}`,
targetProp: "paddingInline",
},
});
});
});
});
16 changes: 3 additions & 13 deletions packages/calcite-components/src/components/select/select.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
* @prop --calcite-select-spacing: [Deprecated] The padding around the selected option text.
* @prop --calcite-select-text-color: The text color of the component.
* @prop --calcite-select-icon-color: The icon color of the component.
*
*/

:host {
Expand Down Expand Up @@ -43,11 +42,6 @@
border-color: none;
}
}

// override user agent stylesheet disabled styling
&:disabled {
border-color: var(--calcite-select-border-color-disabled, var(--calcite-color-border-input));
}
}

.select,
Expand All @@ -59,10 +53,6 @@
color: var(--calcite-select-text-color, var(--calcite-color-text-2));
}

.icon-container {
color: var(--calcite-select-icon-color, var(--calcite-color-text-2));
}

.icon-container {
@apply pointer-events-none absolute inset-y-0 flex items-center border-solid;
background-color: var(--calcite-color-background-none);
Expand All @@ -73,7 +63,7 @@
padding-inline: var(--calcite-internal-select-icon-space-inline);

.icon {
color: var(--calcite-select-icon-color, var(--calcite-color-text-3));
--calcite-icon-color: var(--calcite-select-icon-color, var(--calcite-color-text-3));
}
}

Expand Down Expand Up @@ -111,11 +101,11 @@
}

:host([width="auto"]) {
--calcite-internal-select-size: auto; // TODO: replace w/ design token
--calcite-internal-select-size: auto;
}

:host([width="half"]) {
--calcite-internal-select-size: 50%; // TODO: replace w/ design token
--calcite-internal-select-size: 50%;
}

:host([width="full"]) {
Expand Down