diff --git a/apps/loopover-miner-ui/src/components/chat/typing-indicator.test.tsx b/apps/loopover-miner-ui/src/components/chat/typing-indicator.test.tsx new file mode 100644 index 0000000000..97b6024b35 --- /dev/null +++ b/apps/loopover-miner-ui/src/components/chat/typing-indicator.test.tsx @@ -0,0 +1,23 @@ +import { render } from "@testing-library/react"; +import { describe, expect, it } from "vitest"; + +import { TypingIndicator } from "./typing-indicator"; + +// Regression for #8303: the three animate-bounce dots must each pair their animation with +// motion-reduce:animate-none so a user with the OS "reduce motion" preference set sees a static indicator +// instead of a bouncing one -- matching the guard skeleton.tsx / Spinner already provide. +describe("TypingIndicator respects prefers-reduced-motion (#8303)", () => { + it("renders three bouncing dots that each carry motion-reduce:animate-none", () => { + const { container } = render(); + const dots = container.querySelectorAll(".animate-bounce"); + expect(dots.length).toBe(3); + for (const dot of dots) { + expect(dot.className).toContain("motion-reduce:animate-none"); + } + }); + + it("renders nothing when not composing (unchanged behavior)", () => { + const { container } = render(); + expect(container.firstChild).toBeNull(); + }); +}); diff --git a/apps/loopover-miner-ui/src/components/chat/typing-indicator.tsx b/apps/loopover-miner-ui/src/components/chat/typing-indicator.tsx index 53d33e65ac..5cecec1b09 100644 --- a/apps/loopover-miner-ui/src/components/chat/typing-indicator.tsx +++ b/apps/loopover-miner-ui/src/components/chat/typing-indicator.tsx @@ -16,13 +16,16 @@ export function TypingIndicator({ {label}