nextjs-ui-test
Writes the UI-layer tests of a use case (UC-XXX) for a Next.js App Router client with Vitest and React Testing Library in jsdom: renders the client component that holds the markup, drives it with user-event, mocks the project's API client module, and asserts the rendered content, the messages, and the requests sent to the API, in colocated <Component>.test.tsx files with a describe('UC-XXX: …') block. Reports a Server Component as unreachable and leaves it to the E2E layer. Use when the user asks to "write frontend tests", "write Vitest tests for the page", "write React unit tests", "test the component", "test the UI of UC-001", or mentions React Testing Library, jsdom, or component testing for a Next.js project that combines layer plugins. Normally run by /use-case-test as the UI test layer of a project whose docs/architecture/stack.md names Next.js; it can also be run directly. Browser tests against the running application are /playwright-e2e-test.
Pinned to revision 648476b42261, so it is the text this page describes rather than whatever the author pushed since.
Files
Every link opens the file at its source, pinned to the revision this page describes.