- CV header with highlights and keeping-up summary replaces the intro and Now strip - "Projects I'm proudest of": up to six featured panels; screenshots muted until hover - "Also made" list; searching it also lists matching courses - Record section: recognition & volunteering, courses by topic - /work/learning/: searchable course list (plain script), in the sitemap - Top bar: Projects, Record, Writing, CV; no Bluesky link in the work footer - Highlights: only the placement takes the accent (owner, after the preview) Owner looked at the rendered preview on 2026-11-12 before this commit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
26 lines
1.2 KiB
TypeScript
26 lines
1.2 KiB
TypeScript
import { describe, expect, test } from 'bun:test';
|
|
import { featLayout, featuredOf } from '../../src/site/components/work/sections.ts';
|
|
import type { Project } from '../../src/library/types.ts';
|
|
|
|
const proj = (id: string, featured?: number): Project => ({
|
|
id, title: id, date: '2025-01-01', ai: 'unknown', group: 'work', where: 'x', stack: [], summary: 's', links: [],
|
|
aiParts: [], related: [], bodyHtml: '', ...(featured !== undefined && { featured }),
|
|
});
|
|
|
|
describe('featured panels', () => {
|
|
test('featuredOf takes up to six by rank', () => {
|
|
const ps = [7, 3, 1, 5, 2, 6, 4].map((n) => proj(`p${n}`, n)).concat(proj('none'));
|
|
expect(featuredOf(ps).map((p) => p.id)).toEqual(['p1', 'p2', 'p3', 'p4', 'p5', 'p6']);
|
|
});
|
|
|
|
test('featLayout repeats wide, half, half, wide reversed, half, half; a lone last half goes wide', () => {
|
|
expect(featLayout(0)).toEqual([]);
|
|
expect(featLayout(1)).toEqual(['wide']);
|
|
expect(featLayout(2)).toEqual(['wide', 'wide']);
|
|
expect(featLayout(3)).toEqual(['wide', '', '']);
|
|
expect(featLayout(4)).toEqual(['wide', '', '', 'wide rev']);
|
|
expect(featLayout(5)).toEqual(['wide', '', '', 'wide rev', 'wide']);
|
|
expect(featLayout(6)).toEqual(['wide', '', '', 'wide rev', '', '']);
|
|
});
|
|
});
|