Skip to content

Commit

Permalink
test(navigation-user): add token theming tests (#9410)
Browse files Browse the repository at this point in the history
**Related Issue:** #7180 

## Summary

Add token theming tests for `navigation-user` component.
  • Loading branch information
anveshmekala authored May 29, 2024
1 parent 701987a commit 37d3002
Showing 1 changed file with 38 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { html } from "../../../support/formatting";
import { accessible, defaults, focusable, hidden, reflects, renders } from "../../tests/commonTests";
import { ComponentTestTokens, themed } from "../../tests/commonTests/themed";
import { CSS } from "./resources";

describe("calcite-navigation-user", () => {
describe("renders", () => {
Expand Down Expand Up @@ -39,4 +41,40 @@ describe("calcite-navigation-user", () => {
describe("is focusable", () => {
focusable("calcite-navigation-user");
});

describe("theme", () => {
const navigationUserHtml = html`
<calcite-navigation-user full-name="Walt McChipson" username="waltChip"> </calcite-navigation-user>
`;

describe("default", () => {
const tokens: ComponentTestTokens = {
"--calcite-navigation-user-avatar-corner-radius": {
shadowSelector: `calcite-avatar`,
targetProp: "--calcite-avatar-corner-radius",
},
"--calcite-navigation-user-avatar-text-color": {
shadowSelector: `calcite-avatar`,
targetProp: "--calcite-avatar-text-color",
},
"--calcite-navigation-user-background-color": {
shadowSelector: `.${CSS.button}`,
targetProp: "backgroundColor",
},
"--calcite-navigation-user-border-color": {
shadowSelector: `.${CSS.button}`,
targetProp: "borderBlockEndColor",
},
"--calcite-navigation-user-full-name-text-color": {
shadowSelector: `.${CSS.fullName}`,
targetProp: "color",
},
"--calcite-navigation-user-name-text-color": {
shadowSelector: `.${CSS.username}`,
targetProp: "color",
},
};
themed(navigationUserHtml, tokens);
});
});
});

0 comments on commit 37d3002

Please sign in to comment.