diff --git a/TODO.md b/TODO.md index 6f20254..03c8805 100644 --- a/TODO.md +++ b/TODO.md @@ -187,7 +187,7 @@ This file is the single source of truth for roadmap and delivery progress. ### Testing - [x] [P1] Unit tests for content schemas and service logic -- [~] [P1] Component tests for admin forms (pages/media/navigation) +- [x] [P1] Component tests for admin forms (pages/media/navigation) - [x] [P1] Integration tests for owner invariant and hidden support-user protection - [x] [P1] Integration tests for registration allow/deny behavior - [ ] [P1] Integration tests for translated content CRUD and locale-specific validation @@ -320,6 +320,7 @@ This file is the single source of truth for roadmap and delivery progress. - [2026-02-12] Added owner/support invariant integration tests for auth guards (`apps/admin/src/lib/auth/server.test.ts`), covering protected-user deletion blocking and one-owner repair/promotion rules. - [2026-02-12] Started admin form component tests with media upload behavior coverage (`apps/admin/src/components/media/media-upload-form.test.tsx`). - [2026-02-12] Added code handover documentation baseline: architecture map, critical invariants, request lifecycles, and onboarding playbook under `docs/product-engineering/`. +- [2026-02-12] Completed admin form component coverage for pages/navigation/media using isolated form components and tests. ## How We Use This File diff --git a/apps/admin/src/app/navigation/page.tsx b/apps/admin/src/app/navigation/page.tsx index b6b31ab..0ef2ff4 100644 --- a/apps/admin/src/app/navigation/page.tsx +++ b/apps/admin/src/app/navigation/page.tsx @@ -11,6 +11,8 @@ import { revalidatePath } from "next/cache" import { redirect } from "next/navigation" import { AdminShell } from "@/components/admin-shell" +import { CreateMenuForm } from "@/components/navigation/create-menu-form" +import { CreateNavigationItemForm } from "@/components/navigation/create-navigation-item-form" import { requirePermissionForRoute } from "@/lib/route-guards" export const dynamic = "force-dynamic" @@ -206,123 +208,12 @@ export default async function NavigationManagementPage({

Create Menu

-
- - - - - -
+

Create Navigation Item

-
- - -
- - -
-
- - -
- - -
+
diff --git a/apps/admin/src/app/pages/page.tsx b/apps/admin/src/app/pages/page.tsx index 7b22bc3..67e0dc4 100644 --- a/apps/admin/src/app/pages/page.tsx +++ b/apps/admin/src/app/pages/page.tsx @@ -1,10 +1,10 @@ import { createPage, listPages } from "@cms/db" -import { Button } from "@cms/ui/button" import { revalidatePath } from "next/cache" import Link from "next/link" import { redirect } from "next/navigation" import { AdminShell } from "@/components/admin-shell" +import { CreatePageForm } from "@/components/pages/create-page-form" import { requirePermissionForRoute } from "@/lib/route-guards" export const dynamic = "force-dynamic" @@ -110,75 +110,7 @@ export default async function PagesManagementPage({

Create Page

-
-
- - -
- - - - - -