test(calendar): grid layout, week ordering, and day-cell coverage
- Add isToday test cases to CalendarDay.test.tsx * test --today class when isToday=true * test --today class not applied when isToday=false - Create Calendar.test.tsx with full page coverage * Test 7 weekday headers in Monday-first Swedish order * Verify correct number of day cells (multiple of 7) * Test Sunday-starting month renders correctly (March 2026) * Test modal opens on current-month day click * Test modal doesn't open on disabled day click * Test current month title display * Test prev/next month navigation * Test loading state display - Mocks useWorkspace, usePlannedDays, Layout, LoadingSpinner, PlannedDayModal - All 19 tests pass; no coverage regression Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -93,4 +93,20 @@ describe('CalendarDay', () => {
|
||||
const events = queryByTestId('calendar-day-events')
|
||||
expect(events).not.toBeInTheDocument()
|
||||
})
|
||||
|
||||
it('applies today class when isToday is true', () => {
|
||||
const { getByTestId } = render(
|
||||
<CalendarDay date="2026-06-15" isToday={true} />
|
||||
)
|
||||
const day = getByTestId('calendar-day')
|
||||
expect(day).toHaveClass('calendar-day--today')
|
||||
})
|
||||
|
||||
it('does not apply today class when isToday is false', () => {
|
||||
const { getByTestId } = render(
|
||||
<CalendarDay date="2026-06-15" isToday={false} />
|
||||
)
|
||||
const day = getByTestId('calendar-day')
|
||||
expect(day).not.toHaveClass('calendar-day--today')
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user