HomeView.test.tsx1.0 KBView on GitHub
/**
 * HomeView tests. Under the unified layout the chat is the right sidebar (owned by AppShell),
 * so HomeView is just the /agent context column: DisplayArtifactPanel, which shows the active
 * thread's open conversation/email/file, or the agenda by default. DisplayArtifactPanel is mocked
 * to a sentinel — it needs the full tRPC/canvas provider stack; this is a headless proof of the
 * layout composition.
 */
import React from 'react';
import { render, screen } from '@testing-library/react';

jest.mock('@/modules/home/components/DisplayArtifactPanel', () => ({
  DisplayArtifactPanel: () => <div data-testid="display-artifact">ARTIFACT</div>,
}));

import { HomeView } from '@/modules/home/components/HomeView';

describe('HomeView', () => {
  it('renders the context column (DisplayArtifactPanel) — chat is owned by AppShell', () => {
    render(<HomeView />);
    // The artifact column is unconditional — it defaults to the agenda when nothing is open.
    expect(screen.getByTestId('display-artifact')).toBeInTheDocument();
  });
});