History

test(web): drop sidebar artwork styling snapshots (#10152)

Julius Marminge committed 2 months ago

Commit a324cab1 parent 29c3a541 file · +0 −33Browse files

Unified · Split

apps/web/src/components/SidebarStageBackdrop.test.tsx+0−33
@@ -4,9 +4,7 @@ import { renderToStaticMarkup } from "react-dom/server"; · 3 unmodified lines
44 import {
55 resolveEnvironmentIdentificationPillLabel,
66 resolveSidebarStageBackdropVariant,
7− resolveSidebarStageFocusRingOffsetClass,
87 StageBackdropArt,
9− StageBackdropButtonArt,
108 } from "./SidebarStageBackdrop";
119
1210 describe("SidebarStageBackdrop", () => {
@@ -24,15 +22,6 @@ describe("SidebarStageBackdrop", () => { · 11 unmodified lines
2422 expect(resolveEnvironmentIdentificationPillLabel("Alpha")).toBeNull();
2523 });
2624
27− it("matches the focus-ring offset to each artwork palette", () => {
28− expect(resolveSidebarStageFocusRingOffsetClass("nightly")).toBe(
29− "focus-visible:ring-offset-(--stage-night-bottom)",
30− );
31− expect(resolveSidebarStageFocusRingOffsetClass("dev")).toBe(
32− "focus-visible:ring-offset-(--stage-art-bottom)",
33− );
34− });
35−
3625 it.each(["nightly", "dev"] as const)(
3726 "uses unique SVG definition ids when %s artwork is rendered more than once",
3827 (variant) => {
@@ -48,26 +37,4 @@ describe("SidebarStageBackdrop", () => { · 9 unmodified lines
4837 expect(new Set(ids).size).toBe(ids.length);
4938 },
5039 );
51−
52− it("paints each artwork variant with theme-owned color tokens", () => {
53− const nightlyMarkup = renderToStaticMarkup(<StageBackdropArt variant="nightly" />);
54− const devMarkup = renderToStaticMarkup(<StageBackdropArt variant="dev" />);
55−
56− expect(nightlyMarkup).toContain("var(--stage-night-bottom)");
57− expect(nightlyMarkup).toContain("var(--stage-night-line)");
58− expect(devMarkup).toContain("var(--stage-art-bottom)");
59− expect(devMarkup).toContain("var(--stage-art-line)");
60− expect(nightlyMarkup).not.toMatch(/#[0-9a-f]{3,8}/i);
61− expect(devMarkup).not.toMatch(/#[0-9a-f]{3,8}/i);
62− });
63−
64− it.each([
65− ["nightly", "96 0 8192 96"],
66− ["dev", "64 0 8192 96"],
67− ] as const)("uses the compact %s crop inside the send button", (variant, viewBox) => {
68− const markup = renderToStaticMarkup(<StageBackdropButtonArt variant={variant} />);
69−
70− expect(markup).toContain(`viewBox="${viewBox}"`);
71− expect(markup).toContain(`stage-${variant === "dev" ? "blueprint" : "nightly"}`);
72− });
7340 });

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t