import { describe, expect, it } from 'vitest';

import { getDirectorDashboardDateRange } from '@/business/director-dashboard/hooks';

describe('director dashboard hooks', () => {
  it('builds a Sunday-start range for the selected week', () => {
    expect(getDirectorDashboardDateRange('week', new Date('2026-06-19T12:00:00.000Z'))).toEqual({
      startDate: '2026-06-14',
      endDate: '2026-06-19',
    });
  });

  it('builds a month-to-date range for the selected month', () => {
    expect(getDirectorDashboardDateRange('month', new Date('2026-06-19T12:00:00.000Z'))).toEqual({
      startDate: '2026-06-01',
      endDate: '2026-06-19',
    });
  });

  it('builds a quarter-to-date range for the selected quarter', () => {
    expect(getDirectorDashboardDateRange('quarter', new Date('2026-06-19T12:00:00.000Z'))).toEqual({
      startDate: '2026-04-01',
      endDate: '2026-06-19',
    });
  });
});
