Files
electric-cherry/tests/unit/historical-server-identity.test.ts
T
josh 981fb27c1c Preserve deleted server history
Retain historical server identities, results, and evidence after deletion. Mark archived entries as Deleted and prevent old work from targeting servers that reuse the same name.

Fixes #16.
2026-09-27 21:48:55 -04:00

14 lines
765 B
TypeScript

import { expect, it } from 'vitest';
import { render } from 'svelte/server';
import HistoricalServerIdentity from '../../src/lib/ui/components/HistoricalServerIdentity.svelte';
it('retains deleted identities without linking to a replacement using the same server name', () => {
const props = { name: 't5_zombie_theater_1', href: '/servers/t5_zombie_theater_1' };
const live = render(HistoricalServerIdentity, { props }).body;
expect(live).toContain('href="/servers/t5_zombie_theater_1"');
const deleted = render(HistoricalServerIdentity, { props: { ...props, deletedAt: '2026-09-27T12:00:00Z' } }).body;
expect(deleted).toContain('t5_zombie_theater_1');
expect(deleted).toContain('Deleted');
expect(deleted).not.toContain('href=');
});