fix(web): 管理价格与创作空态 - 合并 PR #373 并保留 create 路由

This commit is contained in:
ddCat
2026-09-01 19:12:10 +08:00
6 changed files with 69 additions and 17 deletions

View File

@@ -29,12 +29,12 @@ describe("workspace route loading", () => {
expect(navigation).toContain("onFocus={() => preloadWorkspaceRoute(linkTo)}");
});
test("uses the creation page as the root entry without legacy home or create routes", () => {
test("keeps the creation page at root and preserves the create compatibility route", () => {
const router = source("../src/router.tsx");
const navigation = source("../src/components/layout/workspace-sidebar-nav.tsx");
expect(router).toContain('{ path: "/", element: <RequireAuth>{deferred(<CreatePage />)}</RequireAuth> }');
expect(router).not.toContain('path: "/create"');
expect(router).toContain('{ path: "/create", element: <RequireAuth>{deferred(<CreatePage />)}</RequireAuth> }');
expect(router).not.toContain('path: "/home"');
expect(router).not.toContain("HomePage");
expect(navigation).toContain('{ id: "home", title: "首页", icon: Home, to: "/" }');