Bots now render as an Oo rig built once in core: nine species, styled Oo eyes, eyewear, headwear, neckwear, arms and moment props, with a level of detail per size. A shared animation frame loop moves only visible avatars and holds still under reduced motion. Claude-Session: https://claude.ai/code/session_01EKuME5CgL1ddGGN7LGvtBj Co-authored-by: Claude <noreply@anthropic.com>
30 lines
1.0 KiB
TypeScript
30 lines
1.0 KiB
TypeScript
import { expect, test } from "@playwright/test";
|
|
|
|
test("bot avatar ring stays still when reduced motion is enabled", async ({ page }) => {
|
|
await page.emulateMedia({ reducedMotion: "reduce" });
|
|
await page.goto("/e2e/fixtures/avatar-motion.html");
|
|
|
|
const avatar = page.locator(".rakazo-bot-avatar");
|
|
await expect(avatar).toBeVisible();
|
|
await expect(avatar).toHaveAttribute("data-working", "true");
|
|
|
|
const ring = avatar.locator(".rakazo-bot-avatar-ring");
|
|
await expect(ring).toBeVisible();
|
|
const snapshot = () =>
|
|
ring.evaluate((el: SVGElement) => ({
|
|
animationName: getComputedStyle(el).animationName,
|
|
transform: getComputedStyle(el).transform,
|
|
}));
|
|
const first = await snapshot();
|
|
await page.waitForTimeout(300);
|
|
const second = await snapshot();
|
|
|
|
expect(first.animationName).toBe("none");
|
|
expect(second).toEqual(first);
|
|
|
|
const rig = avatar.locator('[data-part="rig"]');
|
|
const still = await rig.getAttribute("transform");
|
|
await page.waitForTimeout(300);
|
|
expect(await rig.getAttribute("transform")).toBe(still);
|
|
});
|