also looking at this
Expand BunPress guide and pre-E2E quality gates
#35
40 files
+1524
-373
Review threads live on the whole diff, not on one commit, so none are shown here - a thread's line means something in the branch's final form, and painting it into an intermediate step would put it on code it is not about.
| @@ -0,0 +1,20 @@ | ||
| 1 | import { describe, expect, test } from 'bun:test' | |
| 2 | ||
| 3 | const NOW = '2026-09-12T12:00:00.000Z' | |
| 4 | const report = (index: number, status = 'published') => ({ id: index, slug: `report-${index}`, name: `Report ${index}`, status, blocks: 2 + index % 8, updatedAt: NOW }) | |
| 5 | ||
| 6 | export const productStates = { | |
| 7 | empty: { now: NOW, status: 'ready', reports: [], schedules: 0 }, | |
| 8 | normal: { now: NOW, status: 'ready', reports: [report(1), report(2, 'draft'), report(3)], schedules: 2 }, | |
| 9 | loading: { now: NOW, status: 'loading', reports: [], schedules: null }, | |
| 10 | failure: { now: NOW, status: 'error', reports: [], error: 'Report query failed' }, | |
| 11 | highVolume: { now: NOW, status: 'ready', reports: Array.from({ length: 250 }, (_, index) => report(index + 1)), schedules: 80 }, | |
| 12 | } as const | |
| 13 | ||
| 14 | describe('deterministic report product states', () => { | |
| 15 | test('covers every UI state', () => expect(Object.keys(productStates)).toEqual(['empty', 'normal', 'loading', 'failure', 'highVolume'])) | |
| 16 | test('keeps volume fixtures large and reproducible', () => { | |
| 17 | expect(productStates.highVolume.reports).toHaveLength(250) | |
| 18 | expect(JSON.stringify(productStates)).toBe(JSON.stringify(productStates)) | |
| 19 | }) | |
| 20 | }) | |