[重构] 前端改造v1

This commit is contained in:
ryan
2026-03-11 12:47:08 +08:00
parent 052e3e98f8
commit 6eea676f8f
71 changed files with 3619 additions and 8791 deletions
@@ -0,0 +1,14 @@
import { render, screen } from '@testing-library/react';
import { describe, expect, it } from 'vitest';
import { DashboardOverview } from '@/features/dashboard/components/dashboard-overview';
describe('DashboardOverview', () => {
it('renders stage one heading and readiness items', () => {
render(<DashboardOverview />);
expect(screen.getByText('阶段 1 已启动')).toBeInTheDocument();
expect(screen.getByText('工程底座')).toBeInTheDocument();
expect(screen.getByText('质量工具')).toBeInTheDocument();
});
});
@@ -0,0 +1,15 @@
import { describe, expect, it } from 'vitest';
import { getCurrentNavigationItem, isPathActive } from '@/lib/utils/navigation';
describe('navigation utils', () => {
it('marks root path as active only for home', () => {
expect(isPathActive('/', '/')).toBe(true);
expect(isPathActive('/nodes', '/')).toBe(false);
});
it('resolves current navigation item for nested paths', () => {
expect(getCurrentNavigationItem('/nodes/abc')?.label).toBe('节点管理');
expect(getCurrentNavigationItem('/settings')?.label).toBe('设置');
});
});