// 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.');
  });
});
