evOo-local/packages/core/src/avatar-shape.test.ts
cynarAI 6c7eed7580 Initial clean evOo-local from f00577b
Fresh history cut from cynarAI/evoo antigravity-handoff/project-timeline
(Voice First + project timeline). Brand docs/titles as evOo; keep @rakazo/*
packages as tech debt. Excludes node_modules, caches, secrets, voice blobs.
2026-09-20 17:15:16 +02:00

25 lines
1.0 KiB
TypeScript

import { describe, expect, it } from "vitest";
import { avatarIdentitySeed, organicAvatarPath } from "./avatar-shape.js";
describe("organic avatar geometry", () => {
it("is stable for an identity and changes across identities", () => {
const first = organicAvatarPath(avatarIdentitySeed("research"));
expect(first).toBe(organicAvatarPath(avatarIdentitySeed("research")));
expect(first).not.toBe(organicAvatarPath(avatarIdentitySeed("health")));
});
it("emits only path geometry from a numeric seed", () => {
const path = organicAvatarPath(42);
expect(path).toMatch(/^M[-0-9. ]+(?:C[-0-9. ]+)+Z$/);
expect(path).not.toMatch(/<|>|javascript:|url\(/i);
});
it("produces ten distinct smooth shape families", () => {
const families = Array.from({ length: 10 }, (_, seed) =>
organicAvatarPath(seed, -((seed % 360) * Math.PI) / 180),
);
expect(new Set(families)).toHaveLength(10);
expect(families.every((path) => (path.match(/C/g) ?? []).length >= 12)).toBe(true);
});
});