Skip to content

Commit 0151cbf

Browse files
committed
test: drop class-string tests covered by browser specs
Twelve unit test files mostly asserted class names and markup. The e2e specs and the axe sweep cover their behavior; motion.spec.ts adds the reduced-motion, forced-colors and paused checks.
1 parent 8245b03 commit 0151cbf

14 files changed

Lines changed: 56 additions & 584 deletions

‎e2e/fixtures.tsx‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@ import {
99
DictationStatusLine,
1010
FilterChip,
1111
Select,
12+
ShimmerText,
1213
ThemeProvider,
1314
ThemeToggle,
15+
ThinkingMark,
1416
type ApprovalRequest,
1517
type ChatMessage,
1618
} from "@corbits/react-ui";
@@ -189,6 +191,9 @@ export const scenarios: Record<string, () => ReactNode> = {
189191
Form
190192
</AuthLayout>
191193
),
194+
shimmer: () => <ShimmerText>Thinking</ShimmerText>,
195+
"thinking-mark": () => <ThinkingMark variant="echo" />,
196+
"thinking-mark-paused": () => <ThinkingMark variant="echo" paused />,
192197
theme: () => <Swatches />,
193198
"theme-toggle": () => (
194199
<ThemeProvider storageKey="e2e-theme" defaultMode="light">

‎e2e/motion.spec.ts‎

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
import { expect, test } from "@playwright/test";
2+
3+
const color = (page: import("@playwright/test").Page) =>
4+
page.getByText("Thinking").evaluate((node) => getComputedStyle(node).color);
5+
6+
test("ShimmerText clips a gradient by default", async ({ page }) => {
7+
await page.goto("/shimmer");
8+
expect(await color(page)).toBe("rgba(0, 0, 0, 0)");
9+
});
10+
11+
test("ShimmerText falls back to solid text under reduced motion", async ({
12+
page,
13+
}) => {
14+
await page.emulateMedia({ reducedMotion: "reduce" });
15+
await page.goto("/shimmer");
16+
expect(await color(page)).not.toBe("rgba(0, 0, 0, 0)");
17+
});
18+
19+
test("ShimmerText falls back to solid text under forced colors", async ({
20+
page,
21+
}) => {
22+
await page.emulateMedia({ forcedColors: "active" });
23+
await page.goto("/shimmer");
24+
expect(await color(page)).not.toBe("rgba(0, 0, 0, 0)");
25+
});
26+
27+
test("ThinkingMark echo drops its second wave under reduced motion", async ({
28+
page,
29+
}) => {
30+
await page.goto("/thinking-mark");
31+
const displays = () =>
32+
page
33+
.locator(".corbits-thinking-echo")
34+
.evaluateAll((nodes) =>
35+
nodes.map((node) => getComputedStyle(node).display),
36+
);
37+
expect(await displays()).toEqual(["inline", "inline"]);
38+
await page.emulateMedia({ reducedMotion: "reduce" });
39+
expect(await displays()).toEqual(["inline", "none"]);
40+
});
41+
42+
test("paused ThinkingMark freezes every animation", async ({ page }) => {
43+
await page.goto("/thinking-mark-paused");
44+
const states = await page
45+
.locator("svg *")
46+
.evaluateAll((nodes) =>
47+
nodes.map((node) => getComputedStyle(node).animationPlayState),
48+
);
49+
expect(states.length).toBeGreaterThan(0);
50+
expect(new Set(states)).toEqual(new Set(["paused"]));
51+
});

‎src/blocks/login/auth-layout.test.tsx‎

Lines changed: 0 additions & 48 deletions
This file was deleted.

‎src/icon-tokens.test.ts‎

Lines changed: 0 additions & 37 deletions
This file was deleted.

‎src/ui/block-card.test.tsx‎

Lines changed: 0 additions & 83 deletions
This file was deleted.

‎src/ui/button.test.tsx‎

Lines changed: 0 additions & 64 deletions
This file was deleted.

‎src/ui/dictation-status-line.test.tsx‎

Lines changed: 0 additions & 37 deletions
This file was deleted.

‎src/ui/filter-chip.test.tsx‎

Lines changed: 0 additions & 46 deletions
This file was deleted.

0 commit comments

Comments
 (0)