The base feed now wears the highest ratified era -- sepia film with sprocket holes, phosphor broadcast with interlace, rainbow-on-black disc gloss, the classic SMPTE stream, blinding fortress white. Corruption stays era-agnostic: same shader, same params, only what they are painted onto changes. Boot era is reel, so the world starts in the deepest stratum and climbs to the surface. The old SMPTE look is now mid-game. The chyron generalises from an idle-only placard to a line of text, which is what lets the radio caption the sky in a later commit. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
55 lines
1.9 KiB
TypeScript
55 lines
1.9 KiB
TypeScript
import { describe, expect, it } from 'vitest';
|
|
import { ERA_ORDER, eraSkin, highestEra, type Era } from './eras';
|
|
|
|
const eraOf = (t: string): Era | undefined =>
|
|
({ a: 'reel', b: 'broadcast', c: 'disc', d: 'stream', e: 'fortress' } as Record<string, Era>)[t];
|
|
|
|
describe('era skins cover the codex', () => {
|
|
it('has a distinct skin for every era', () => {
|
|
const bars = new Set<string>();
|
|
for (const era of ERA_ORDER) {
|
|
const skin = eraSkin(era);
|
|
expect(skin.bars).toHaveLength(7); // the substrate keeps SMPTE structure; only palette ages
|
|
expect(skin.casts).toHaveLength(7);
|
|
bars.add(skin.bars.join(','));
|
|
}
|
|
expect(bars.size).toBe(ERA_ORDER.length); // no two eras look alike
|
|
});
|
|
|
|
it('is deterministic — the same era always paints the same substrate', () => {
|
|
expect(eraSkin('disc')).toEqual(eraSkin('disc'));
|
|
});
|
|
|
|
it('runs oldest to newest, reel first and fortress last', () => {
|
|
expect(ERA_ORDER[0]).toBe('reel');
|
|
expect(ERA_ORDER[ERA_ORDER.length - 1]).toBe('fortress');
|
|
});
|
|
});
|
|
|
|
describe('highest ratified era', () => {
|
|
it('starts in the deepest stratum when nothing is ratified', () => {
|
|
expect(highestEra([], eraOf)).toBe('reel');
|
|
});
|
|
|
|
it('takes the newest era present, not the last listed', () => {
|
|
expect(highestEra(['c', 'a', 'b'], eraOf)).toBe('disc');
|
|
expect(highestEra(['e', 'a'], eraOf)).toBe('fortress');
|
|
});
|
|
|
|
it('ignores tech it cannot place rather than falling over', () => {
|
|
// LANE-DATA can add tech ahead of me; unknown ids must not crash or reset the era.
|
|
expect(highestEra(['b', 'who-knows'], eraOf)).toBe('broadcast');
|
|
});
|
|
|
|
it('never goes backwards as more tech is ratified', () => {
|
|
let prev = -1;
|
|
const acc: string[] = [];
|
|
for (const t of ['a', 'b', 'c', 'd', 'e']) {
|
|
acc.push(t);
|
|
const idx = ERA_ORDER.indexOf(highestEra(acc, eraOf));
|
|
expect(idx).toBeGreaterThanOrEqual(prev);
|
|
prev = idx;
|
|
}
|
|
});
|
|
});
|