import { ACTIVE_RUN_STATUSES } from "@rakazo/core";
import { renderToString } from "react-dom/server";
import { describe, expect, it } from "vitest";
import {
BotAvatar,
DEFAULT_GROK_BOT_COLOR,
GROK_BOT_COLORS,
GrokShapePreview,
parseBotAvatar,
resolvePersonaColorDef,
resolvePersonaShape,
} from "./bot-avatar.js";
describe("BotAvatar", () => {
it("renders distinct shape gradient IDs for concurrent working avatars", () => {
const html = renderToString(
,
);
const bodyGradIds = [...html.matchAll(/id="(evoo-body-[^"]+)"/g)].map((m) => m[1]);
expect(bodyGradIds).toHaveLength(2);
expect(new Set(bodyGradIds).size).toBe(2);
for (const id of bodyGradIds) {
expect(html).toContain(`url(#${id})`);
}
});
it.each([...ACTIVE_RUN_STATUSES])("marks active run status %s as working", (status) => {
const html = renderToString();
expect(html).toContain("