import { render, screen } from '@testing-library/react';
import { describe, expect, it } from 'vitest';
import { ActivityHeatmap } from '@/components/ActivityHeatmap';
describe('ActivityHeatmap', () => {
it('renders 168 cells with aria labels', () => {
const grid = Array.from({ length: 7 }, () => Array.from({ length: 24 }, () => 0));
grid[0]![20] = 45;
grid[6]![9] = 5;
render();
const cells = screen.getAllByRole('img');
expect(cells).toHaveLength(168);
expect(screen.getByRole('img', { name: 'Montag, 20 Uhr: 45 Minuten' })).toBeInTheDocument();
expect(screen.getByRole('img', { name: 'Sonntag, 9 Uhr: 5 Minuten' })).toBeInTheDocument();
});
it('shows an empty note when there is no activity', () => {
const grid = Array.from({ length: 7 }, () => Array.from({ length: 24 }, () => 0));
render();
expect(screen.getByText('In den letzten 90 Tagen keine Sitzungen erfasst.')).toBeInTheDocument();
});
});