import { render, screen, within } from '@testing-library/react';
import { expect, it } from 'vitest';
import type { ScheduleWeek } from '@alqove/api-client';
import { WeekGrid } from '../week-grid';
it('keeps final-day pre-cutoff shifts visible with their actual local date', () => {
  const week: ScheduleWeek = { week_start: '2026-09-07', starts_at: '2026-09-07T11:00:00Z', ends_at: '2026-09-14T11:00:00Z', timezone: 'America/Los_Angeles', publication: null, shifts: [{ id: 'shift', store_id: 'store', store_membership_id: null, member_name: null, position_id: null, position_name: null, starts_at: '2026-09-14T09:00:00Z', ends_at: '2026-09-14T10:00:00Z', notes: null, published_at: null, revision: 'opaque' }] };
  render(<WeekGrid week={week} />);
  const cell = screen.getByRole('cell', { name: 'Open shifts, 2026-09-13' });
  expect(within(cell).getByText('2026-09-14')).toBeInTheDocument();
  expect(within(cell).getByText('02:00 – 03:00')).toBeInTheDocument();
});
