Files
vyndr/tests/unit/emptyState.test.js
T
builtbykev c8790fde55 Session 57: Phase 0 — Kill the Lies (2309 tests)
Work-order Phase 0 (Jul 10 live audit): every fabricated UI element deleted
or rewired to real data. Deletion sprint — no new product features.

0.1 Fake NBA game: root cause was scheduleService fetching the ESPN
    scoreboard with no ?dates= param or date filter — off-season ESPN
    returns the NEAREST slate (Jun 13 NYK@SA Finals rendered as tonight).
    Now pinned to the requested ET date + defensive filter; undated events
    dropped. Honest month-aware per-sport empty states (lib/emptyState.js).
0.2 Fake header counters: liveTick stripped to a bare 1s pulse (the
    auto-incrementing "247 graded", sin-driven brain-%, aPlus/cascades are
    dead). New GET /api/snapshot/summary (cache-only, before /:sport) +
    Next proxy; HeartbeatBar shows the real graded count and SYNC =
    elapsed since the last pipeline run (amber past 5 min).
0.3 Ticker: hardcoded fallback items deleted (real snapshot exhaust only);
    MOVE kept — computeLineDeltas is real movement. <4 real items → no
    ticker; bar publishes --ticker-h so the fixed header collapses cleanly.
0.4 /terminal retired: route redirects to /dashboard; VVI/injury-wire/
    leaders layouts preserved unrouted as §12 content-engine templates.
    Nav PRIMARY = Slate/Scan/Ledger; BottomTabBar Terminal→Explore; PWA
    shortcut Terminal→Ledger; #terminal alias → /dashboard.
0.5 ›Query nav pill deleted (duplicate /scan link).

Backend 2289 → 2309 tests (199 suites), web build exit 0.
Spec: specs/phase-0-kill-the-lies.md. Next: work-order Phase 1 (ledger
persistence + settlement).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-10 20:17:49 -04:00

47 lines
1.8 KiB
JavaScript

// Session 57 (Phase 0) — honest per-sport empty-slate copy (spec §6).
// An off-season sport names its return window; an in-season sport calls it an
// off-day. Never fixture games, never passive "waiting" language.
const { emptyStateCopy } = require('../../web/src/lib/emptyState');
const july = new Date('2026-07-10T12:00:00');
const december = new Date('2026-12-10T12:00:00');
const march = new Date('2026-03-10T12:00:00');
describe('emptyStateCopy', () => {
test('NBA in July → off-season, returns in October', () => {
const { title } = emptyStateCopy('nba', july);
expect(title).toBe('NBA returns in October.');
});
test('NBA in December → in-season off-day', () => {
const { title } = emptyStateCopy('nba', december);
expect(title).toBe('No NBA games today.');
});
test('WNBA in March → off-season, returns in May', () => {
expect(emptyStateCopy('wnba', march).title).toBe('WNBA returns in May.');
});
test('WNBA in July → in-season off-day', () => {
expect(emptyStateCopy('wnba', july).title).toBe('No WNBA games today.');
});
test('MLB in December → off-season', () => {
expect(emptyStateCopy('mlb', december).title).toBe('MLB returns in spring.');
});
test('soccer has no off-season branch → off-day copy', () => {
expect(emptyStateCopy('soccer', july).title).toBe('No Soccer games today.');
});
test('unknown sport / "all" tab falls back to the generic line', () => {
expect(emptyStateCopy('all', july).title).toBe('No games on the board today.');
expect(emptyStateCopy(undefined, july).title).toBe('No games on the board today.');
});
test('handles uppercase sport ids (dashboard passes NBA.toLowerCase(), but be safe)', () => {
expect(emptyStateCopy('NBA', july).title).toBe('NBA returns in October.');
});
});