diff --git a/frontend/src/__tests__/calendar/CalendarKanban.test.tsx b/frontend/src/__tests__/calendar/CalendarKanban.test.tsx
new file mode 100644
index 0000000..cd0696b
--- /dev/null
+++ b/frontend/src/__tests__/calendar/CalendarKanban.test.tsx
@@ -0,0 +1,66 @@
+import React from 'react';
+import { describe, it, expect, vi, beforeEach } from 'vitest';
+import { render, screen, waitFor } from '@testing-library/react';
+
+vi.mock('@/api/calendar', () => ({
+ fetchKanbanBoard: vi.fn().mockResolvedValue({
+ open: [
+ { id: 'e1', calendar_id: 'cal1', entry_type: 'task', subtype: 'normal', title: 'Recherche', all_day: false, priority: 'medium', status: 'open', created_by: 'u1', due_date: '2024-07-01T00:00:00Z' },
+ ],
+ in_progress: [
+ { id: 'e2', calendar_id: 'cal1', entry_type: 'task', subtype: 'normal', title: 'Implementation', all_day: false, priority: 'high', status: 'in_progress', created_by: 'u1', due_date: '2024-07-02T00:00:00Z' },
+ ],
+ done: [
+ { id: 'e3', calendar_id: 'cal1', entry_type: 'task', subtype: 'normal', title: 'Tests', all_day: false, priority: 'low', status: 'done', created_by: 'u1', due_date: '2024-07-03T00:00:00Z' },
+ ],
+ cancelled: [],
+ }),
+ updateEntry: vi.fn().mockResolvedValue({ id: 'e1', status: 'in_progress' }),
+}));
+
+vi.mock('@/components/calendar/KanbanBoard', () => ({
+ KanbanBoard: ({ board, loading }: any) => (
+
+ {loading ? 'Loading...' : `Open: ${board.open.length}, In Progress: ${board.in_progress.length}, Done: ${board.done.length}`}
+
+ ),
+}));
+
+vi.mock('@/components/calendar/TaskDetailPanel', () => ({
+ TaskDetailPanel: () => TaskDetailPanel
,
+}));
+
+import { CalendarKanbanPage } from '@/pages/CalendarKanban';
+
+describe('CalendarKanbanPage', () => {
+ it('renders kanban page', async () => {
+ render();
+ expect(screen.getByTestId('kanban-page')).toBeInTheDocument();
+ });
+
+ it('renders kanban board component', async () => {
+ render();
+ await waitFor(() => {
+ expect(screen.getByTestId('kanban-board-stub')).toBeInTheDocument();
+ });
+ });
+
+ it('renders board with tasks after loading', async () => {
+ render();
+ await waitFor(() => {
+ expect(screen.getByText(/Open: 1, In Progress: 1, Done: 1/)).toBeInTheDocument();
+ });
+ });
+
+ it('renders page title', async () => {
+ render();
+ expect(screen.getByTestId('kanban-page')).toBeInTheDocument();
+ });
+
+ it('does not render error when load succeeds', async () => {
+ render();
+ await waitFor(() => {
+ expect(screen.queryByTestId('kanban-error')).not.toBeInTheDocument();
+ });
+ });
+});
diff --git a/frontend/src/__tests__/calendar/CalendarPage.test.tsx b/frontend/src/__tests__/calendar/CalendarPage.test.tsx
new file mode 100644
index 0000000..d2c5ce5
--- /dev/null
+++ b/frontend/src/__tests__/calendar/CalendarPage.test.tsx
@@ -0,0 +1,109 @@
+import React from 'react';
+import { describe, it, expect, vi, beforeEach } from 'vitest';
+import { render, screen, waitFor } from '@testing-library/react';
+
+vi.mock('@/api/calendar', () => ({
+ fetchCalendars: vi.fn().mockResolvedValue([
+ { id: 'cal1', name: 'Personal', type: 'personal', color: '#3b82f6', owner_id: 'u1', shared: false, share_permissions: [] },
+ { id: 'cal2', name: 'Team', type: 'team', color: '#10b981', owner_id: 'u1', shared: true, share_permissions: [] },
+ ]),
+ createCalendar: vi.fn().mockResolvedValue({ id: 'cal3', name: 'New', type: 'personal', color: '#000', owner_id: 'u1', shared: false, share_permissions: [] }),
+ listEntries: vi.fn().mockResolvedValue([
+ { id: 'e1', calendar_id: 'cal1', entry_type: 'appointment', subtype: 'normal', title: 'Team Meeting', all_day: false, priority: 'medium', status: 'open', start: '2024-07-01T10:00:00Z', end: '2024-07-01T11:00:00Z', created_by: 'u1' },
+ ]),
+ updateEntry: vi.fn().mockResolvedValue({}),
+ deleteEntry: vi.fn().mockResolvedValue({}),
+}));
+
+vi.mock('@/components/calendar/CalendarTree', () => ({
+ CalendarTree: () => CalendarTree
,
+}));
+vi.mock('@/components/calendar/MonthView', () => ({
+ MonthView: () => MonthView
,
+}));
+vi.mock('@/components/calendar/WeekView', () => ({
+ WeekView: () => WeekView
,
+}));
+vi.mock('@/components/calendar/DayView', () => ({
+ DayView: () => DayView
,
+}));
+vi.mock('@/components/calendar/RangeView', () => ({
+ RangeView: () => RangeView
,
+}));
+vi.mock('@/components/calendar/CalendarDetail', () => ({
+ CalendarDetail: () => CalendarDetail
,
+}));
+vi.mock('@/components/calendar/AppointmentModal', () => ({
+ AppointmentModal: () => AppointmentModal
,
+}));
+vi.mock('@/components/calendar/IcsControls', () => ({
+ IcsControls: () => IcsControls
,
+}));
+vi.mock('@/components/calendar/SharingSettings', () => ({
+ SharingSettings: () => SharingSettings
,
+}));
+vi.mock('@/components/ui/ResizablePanel', () => ({
+ ResizablePanel: ({ children, ...props }: any) => {children}
,
+}));
+vi.mock('@/components/ui/ConfirmDialog', () => ({
+ ConfirmDialog: () => null,
+}));
+vi.mock('@/components/ui/Toast', () => ({
+ useToast: () => ({ success: vi.fn(), error: vi.fn(), info: vi.fn() }),
+}));
+
+import { CalendarPage } from '@/pages/Calendar';
+
+describe('CalendarPage', () => {
+ it('renders calendar page container', async () => {
+ render();
+ expect(screen.getByTestId('calendar-page')).toBeInTheDocument();
+ });
+
+ it('renders calendar tree pane', async () => {
+ render();
+ await waitFor(() => {
+ expect(screen.getByTestId('calendar-tree-pane')).toBeInTheDocument();
+ });
+ });
+
+ it('renders calendar view pane', async () => {
+ render();
+ await waitFor(() => {
+ expect(screen.getByTestId('calendar-view-pane')).toBeInTheDocument();
+ });
+ });
+
+ it('renders calendar detail pane', async () => {
+ render();
+ await waitFor(() => {
+ expect(screen.getByTestId('calendar-detail-pane')).toBeInTheDocument();
+ });
+ });
+
+ it('renders CalendarTree component', async () => {
+ render();
+ // CalendarTree is rendered inside both desktop and mobile panes
+ await waitFor(() => {
+ expect(screen.getAllByTestId('calendar-tree-stub').length).toBeGreaterThan(0);
+ });
+ });
+
+ it('renders MonthView by default', async () => {
+ render();
+ await waitFor(() => {
+ expect(screen.getByTestId('month-view-stub')).toBeInTheDocument();
+ });
+ });
+
+ it('renders mobile calendar tree pane', async () => {
+ render();
+ expect(screen.getByTestId('mobile-calendar-tree-pane')).toBeInTheDocument();
+ });
+
+ it('renders mobile calendar view pane only after navigation', async () => {
+ render();
+ // Mobile view starts on 'tree', so view pane should not be visible initially
+ expect(screen.queryByTestId('mobile-calendar-view-pane')).not.toBeInTheDocument();
+ });
+});