完善客户端模块与工作区能力
This commit is contained in:
@@ -7,7 +7,11 @@ import { useProjectConfigStore } from '@/stores/project-config';
|
||||
import { createProjectConfig } from '../../shared/project-config';
|
||||
|
||||
vi.mock('@/components/layout/Sidebar', () => ({ Sidebar: () => <aside data-testid="sidebar-stub" /> }));
|
||||
vi.mock('@/components/layout/TitleBar', () => ({ TitleBar: () => <header data-testid="titlebar-stub" /> }));
|
||||
vi.mock('@/components/layout/TitleBar', () => ({
|
||||
TitleBar: ({ overlay = false }: { overlay?: boolean }) => (
|
||||
<header data-testid="titlebar-stub" data-overlay={overlay ? 'true' : 'false'} />
|
||||
),
|
||||
}));
|
||||
|
||||
function renderLayout(path: string) {
|
||||
render(
|
||||
@@ -46,9 +50,24 @@ describe('MainLayout module isolation', () => {
|
||||
expect(screen.queryByTestId('project-initialization-gate')).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('uses the full-height workspace shell for AI painting', () => {
|
||||
renderLayout('/image-canvas');
|
||||
|
||||
expect(screen.getByTestId('main-content')).toHaveClass('basis-0', 'h-full', 'overflow-hidden', 'p-0');
|
||||
expect(screen.getByTestId('main-content')).not.toHaveClass('p-5', 'sm:p-6');
|
||||
expect(screen.getByTestId('titlebar-stub')).toHaveAttribute('data-overlay', 'true');
|
||||
});
|
||||
|
||||
it('keeps the local project initialization gate for AI programming routes', () => {
|
||||
renderLayout('/opencode-chat');
|
||||
|
||||
expect(screen.getByTestId('project-initialization-gate')).toBeVisible();
|
||||
expect(screen.getByTestId('titlebar-stub')).toHaveAttribute('data-overlay', 'false');
|
||||
});
|
||||
|
||||
it('keeps the programming workspace padding compensation separate from painting', () => {
|
||||
renderLayout('/opencode-chat');
|
||||
|
||||
expect(screen.getByTestId('main-content')).toHaveClass('basis-0', 'overflow-hidden', 'p-0', 'sm:p-6');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user