fix(ui): align theme toggle with dashboard style
This commit is contained in:
parent
c84de9aaa9
commit
9c948bd746
7 changed files with 99 additions and 17 deletions
|
|
@ -6,6 +6,7 @@ import { FooterCell } from "./FooterCell";
|
|||
import { IconButton } from "./IconButton";
|
||||
import { ServiceRow } from "./ServiceRow";
|
||||
import { TelemetryCard } from "./TelemetryCard";
|
||||
import { ThemeToggle } from "./ThemeToggle";
|
||||
import { dashboardPreviewFixtures } from "../fixtures";
|
||||
|
||||
describe("dashboard UI components", () => {
|
||||
|
|
@ -144,4 +145,20 @@ describe("dashboard UI components", () => {
|
|||
expect(iconButton).toContain("class=\"icon-button custom-icon-action ");
|
||||
expect(iconButton).toContain("aria-expanded=\"false\"");
|
||||
});
|
||||
|
||||
test("renders the theme toggle as a segmented instrument control", () => {
|
||||
const body = renderToString(
|
||||
<ThemeToggle theme="light" onThemeChange={() => undefined} />,
|
||||
);
|
||||
|
||||
expect(body).toContain('class="theme-toggle"');
|
||||
expect(body).toContain('data-ui-theme-current="light"');
|
||||
expect(body).toContain('aria-label="Switch to dark theme"');
|
||||
expect(body).toContain('class="theme-toggle__label"');
|
||||
expect(body).toContain('class="theme-toggle__switch"');
|
||||
expect(body).toContain('data-active="true"');
|
||||
expect(body).toContain("Theme");
|
||||
expect(body).toContain("Dark");
|
||||
expect(body).toContain("Light");
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue