feat: remove Learning module
This commit is contained in:
@@ -7,7 +7,7 @@ import { useProjectConfigStore } from '@/stores/project-config';
|
||||
import { useSettingsStore } from '@/stores/settings';
|
||||
import { createCodingProjectConfigV2 } from '@electron/coding-projects/project-config';
|
||||
|
||||
const learningIpcMock = vi.hoisted(() => vi.fn());
|
||||
const routeRenderMock = vi.hoisted(() => vi.fn());
|
||||
|
||||
vi.mock('@/components/layout/Sidebar', () => ({
|
||||
Sidebar: ({ sidebarCollapsedOverride }: { sidebarCollapsedOverride?: boolean }) => (
|
||||
@@ -26,8 +26,8 @@ vi.mock('@/components/layout/TitleBar', () => ({
|
||||
),
|
||||
}));
|
||||
|
||||
function LearningRouteContent() {
|
||||
learningIpcMock();
|
||||
function RouteContent() {
|
||||
routeRenderMock();
|
||||
return <div data-testid="route-content" />;
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ function renderLayout(path: string) {
|
||||
<MemoryRouter initialEntries={[path]}>
|
||||
<Routes>
|
||||
<Route element={<MainLayout />}>
|
||||
<Route path="*" element={<LearningRouteContent />} />
|
||||
<Route path="*" element={<RouteContent />} />
|
||||
</Route>
|
||||
</Routes>
|
||||
</MemoryRouter>,
|
||||
@@ -45,7 +45,7 @@ function renderLayout(path: string) {
|
||||
|
||||
describe('MainLayout module isolation', () => {
|
||||
beforeEach(() => {
|
||||
learningIpcMock.mockReset();
|
||||
routeRenderMock.mockReset();
|
||||
const project = {
|
||||
id: 'local-project',
|
||||
path: '/tmp/local-project',
|
||||
@@ -118,16 +118,4 @@ describe('MainLayout module isolation', () => {
|
||||
expect(screen.getByTestId('main-content')).toHaveClass('basis-0', 'overflow-hidden', 'p-0', 'sm:p-6');
|
||||
});
|
||||
|
||||
it.each(['/learning', '/learning/project/project-1'])(
|
||||
'keeps the project catalog route %s in the standard integrated shell',
|
||||
(path) => {
|
||||
renderLayout(path);
|
||||
|
||||
expect(screen.getByTestId('sidebar-stub')).toBeVisible();
|
||||
expect(screen.getByTestId('titlebar-stub')).toHaveAttribute('data-integrated', 'true');
|
||||
expect(screen.getByTestId('main-content')).toHaveClass('p-5', 'sm:p-6');
|
||||
expect(screen.getByTestId('route-content')).toBeVisible();
|
||||
expect(screen.queryByTestId('learning-profile-sync-error-gate')).not.toBeInTheDocument();
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user