fix: isolate settings and unify account controls with Code

This commit is contained in:
鲨鱼辣椒 committed 2026-10-13 15:15:27 +08:00
1 parent 430233f825
commit 2cc542f1f8
32 files changed
+759 -1091

No files matched your search

@@ -44,6 +44,9 @@ vi.mock('@/components/layout/TitleBar', () => ({
/>
),
}));
vi.mock('@/components/account/StandaloneAccountDock', () => ({
StandaloneAccountDock: () => <div data-testid="standalone-account-dock-stub" />,
}));
function RouteContent() {
routeRenderMock();
@@ -68,6 +71,16 @@ describe('MainLayout module isolation', () => {
useSettingsStore.setState({ sidebarCollapsed: false });
});
it.each(['/settings', '/settings/proxy'])('gives %s independent chrome without a project sidebar or collapse control', path => {
renderLayout(path);
expect(screen.getByTestId('settings-layout')).toBeVisible();
expect(screen.getByTestId('route-content')).toBeVisible();
expect(screen.queryByTestId('sidebar-stub')).not.toBeInTheDocument();
expect(screen.getByTestId('titlebar-stub')).toHaveAttribute('data-sidebar-controls', 'false');
expect(screen.getByTestId('titlebar-stub')).toHaveAttribute('data-page-title', '设置');
expect(screen.getByTestId('standalone-account-dock-stub')).toBeVisible();
});
it('does not overlay the local project initialization gate on AI painting', () => {
renderLayout('/image-canvas');