nexus/ui/src/lib/agent-role-colors.test.ts
Nexus Dev 6567ea700a feat(22-00): DB migration, shared types, react-virtual, agent-role-colors, CSS animation
- Add updatedAt column to chat_messages schema (nullable)
- Create migration 0048_add_chat_messages_updated_at.sql
- Add updatedAt: string | null to ChatMessage shared type
- Install @tanstack/react-virtual in ui workspace
- Create agent-role-colors.ts with 11 distinct themed roles (THEME-03)
- Add agent-role-colors.test.ts (4 tests all passing)
- Add cursor-blink CSS animation with prefers-reduced-motion guard
2026-04-02 15:08:50 +00:00

28 lines
914 B
TypeScript

import { describe, it, expect } from "vitest";
import { AGENT_ROLES } from "@paperclipai/shared";
import { agentRoleColors, agentRoleColorDefault } from "./agent-role-colors";
describe("agentRoleColors", () => {
it("has an entry for every AGENT_ROLES value", () => {
for (const role of AGENT_ROLES) {
expect(agentRoleColors[role]).toBeDefined();
expect(agentRoleColors[role]).toContain("text-");
}
});
it("each entry has both light and dark variant", () => {
for (const role of AGENT_ROLES) {
expect(agentRoleColors[role]).toContain("dark:");
}
});
it("exports a default fallback color", () => {
expect(agentRoleColorDefault).toBe("text-muted-foreground");
});
it("all 11 roles have distinct color classes", () => {
const colors = Object.values(agentRoleColors);
const unique = new Set(colors);
expect(unique.size).toBe(colors.length);
});
});