fix: 审查修补前端布局重构并归档 change
- 补实现 ProtectedRoute 空壳组件(预留接口,不启用认证逻辑) - 修复页面组件内联 style 为 CSS 类,符合样式规范 - 补充 Sidebar 菜单项激活状态测试、404 按钮可点击测试 - 回写 admin-layout spec Header 页面标题 fallback 行为 - 同步 delta specs 至主规范(admin-layout、frontend-routing、app-constants) - 归档 refactor-frontend-layout change
This commit is contained in:
@@ -21,4 +21,12 @@ describe("Sidebar", () => {
|
||||
expect(screen.getByText("用户管理")).not.toBeNull();
|
||||
expect(screen.getByText("系统设置")).not.toBeNull();
|
||||
});
|
||||
|
||||
test("高亮当前路由对应的菜单项", () => {
|
||||
renderWithProviders(createElement(Sidebar, { collapsed: false }), { initialRoute: "/users" });
|
||||
|
||||
const activeItem = document.querySelector(".t-is-active");
|
||||
expect(activeItem).not.toBeNull();
|
||||
expect(activeItem?.textContent).toContain("用户管理");
|
||||
});
|
||||
});
|
||||
|
||||
@@ -13,4 +13,12 @@ describe("NotFoundPage", () => {
|
||||
expect(screen.getByText("您访问的页面不存在")).not.toBeNull();
|
||||
expect(screen.getByText("返回首页")).not.toBeNull();
|
||||
});
|
||||
|
||||
test("返回首页按钮存在且可点击", () => {
|
||||
renderWithProviders(createElement(NotFoundPage));
|
||||
|
||||
const button = screen.getByText("返回首页");
|
||||
expect(button).not.toBeNull();
|
||||
expect(button.closest("button")).not.toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user