Skip to content

Commit

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

## Summary

Add token test for `navigation-logo` component.
  • Loading branch information
anveshmekala authored May 24, 2024
1 parent 2911449 commit 5247712
Showing 1 changed file with 39 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, focusable, hidden, reflects, renders, defaults } from "../../tests/commonTests";
import { ComponentTestTokens, themed } from "../../tests/commonTests/themed";
import { CSS } from "./resources";

describe("calcite-navigation-logo", () => {
describe("renders", () => {
Expand Down Expand Up @@ -67,4 +69,41 @@ describe("calcite-navigation-logo", () => {
},
]);
});

describe("theme", () => {
const navigationLogoHtml = html`
<calcite-navigation-logo heading="Walt's Chips" description="Eastern Potato Chip Company" icon="layers">
</calcite-navigation-logo>
`;

describe("default", () => {
const tokens: ComponentTestTokens = {
"--calcite-navigation-logo-background-color": {
shadowSelector: `.${CSS.anchor}`,
targetProp: "backgroundColor",
},
"--calcite-navigation-logo-border-color": {
shadowSelector: `.${CSS.anchor}`,
targetProp: "borderBlockEndColor",
},
"--calcite-navigation-logo-description-text-color": {
shadowSelector: `.${CSS.description}`,
targetProp: "color",
},
"--calcite-navigation-logo-heading-text-color": {
shadowSelector: `.${CSS.anchor}`,
targetProp: "color",
},
"--calcite-navigation-logo-icon-color": {
shadowSelector: `.${CSS.icon}`,
targetProp: "color",
},
"--calcite-navigation-logo-text-color": {
shadowSelector: `.${CSS.icon}`,
targetProp: "color",
},
};
themed(navigationLogoHtml, tokens);
});
});
});

0 comments on commit 5247712

Please sign in to comment.