Skip to content
Merged
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
67 changes: 66 additions & 1 deletion packages/calcite-components/src/components/shell/shell.e2e.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { newE2EPage } from "@stencil/core/testing";
import { accessible, hidden, renders, slots } from "../../tests/commonTests";
import { accessible, hidden, renders, slots, themed } from "../../tests/commonTests";
import { html } from "../../../support/formatting";
import { ComponentTestTokens } from "../../tests/commonTests/themed";
import { CSS, SLOTS } from "./resources";

describe("calcite-shell", () => {
Expand Down Expand Up @@ -122,3 +123,67 @@ describe("calcite-shell", () => {
expect(panelTop).toBeNull();
});
});

describe("theme", () => {
const shellHTML = html`
<calcite-shell>
<calcite-tip-manager>
<calcite-tip heading="Example tip title">
<calcite-link href="http://www.esri.com">An example link</calcite-link>
</calcite-tip>
</calcite-tip-manager>
<calcite-panel heading="Leading panel content"></calcite-panel>
<calcite-flow heading="Leading panel content"></calcite-flow>
<calcite-shell-center-row slot="${SLOTS.panelBottom}"></calcite-shell-center-row>
<calcite-shell-center-row slot="${SLOTS.panelTop}"></calcite-shell-center-row>
<calcite-shell-center-row slot="${SLOTS.centerRow}"></calcite-shell-center-row>
</calcite-shell>
`;

describe("slotted overrides", () => {
const tokens: ComponentTestTokens = {
"--calcite-shell-border-color": [
{
selector: `calcite-panel`,
targetProp: "borderColor",
},
{
selector: `calcite-flow`,
targetProp: "borderColor",
},
{
selector: `calcite-shell-center-row[slot="${SLOTS.panelBottom}"]`,
targetProp: "borderColor",
},
{
selector: `calcite-shell-center-row[slot="${SLOTS.panelTop}"]`,
targetProp: "borderColor",
},
{
selector: `calcite-shell-center-row[slot="${SLOTS.centerRow}"]`,
targetProp: "borderColor",
},
],
};
themed(async () => shellHTML, tokens);
});

describe("default", () => {
const tokens: ComponentTestTokens = {
"--calcite-shell-background-color": {
targetProp: "backgroundColor",
},
};
themed(async () => shellHTML, tokens);
});

describe("deprecated", () => {
const tokens: ComponentTestTokens = {
"--calcite-shell-tip-spacing": {
selector: `calcite-tip-manager`,
targetProp: "insetInline",
},
};
themed(async () => shellHTML, tokens);
});
});