Functional design, NFR requirements, code generation plan and summary, and build-and-test instructions with results. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
39 lines
2.1 KiB
Markdown
39 lines
2.1 KiB
Markdown
# Integration Test Instructions — frontend-shell
|
|
|
|
## Purpose
|
|
This feature is a single unit, so there are no cross-unit or cross-service calls. Integration here means **the real app wired together**:
|
|
- the generated route tree
|
|
- router options as in `main.tsx` (scroll restoration, default error component)
|
|
- the Chakra theme
|
|
- the shell around every page
|
|
- the head management per route
|
|
- the build-time sitemap
|
|
|
|
## Automated scenarios (`src/app.test.tsx`, part of `pnpm test`)
|
|
|
|
| # | Scenario | Expected |
|
|
|---|---|---|
|
|
| 1 | Every route in `sitePages` renders | Inside the shell (banner + contentinfo), exactly one `h1`, no axe violations |
|
|
| 2 | `/portfolio` head | Title "Portfolio \| Andrea Slop Fotografie", canonical `https://andreaslop.nl/portfolio`, `robots: noindex` |
|
|
| 3 | Structured data | Exactly one `application/ld+json` block of type `ProfessionalService` |
|
|
| 4 | Unknown URL `/bestaat-niet` | "Pagina niet gevonden" inside the shell, no axe violations |
|
|
| 5 | A page throws while rendering | "Er ging iets mis" inside the shell; error text not shown |
|
|
| 6 | Page registry vs route tree | Same set of paths (BR-SEO-07) |
|
|
| 7 | Page registry vs Lighthouse URLs | `lighthouserc.cjs` lists the same indexed / noindex pages |
|
|
|
|
Also in `pnpm test`: `useRouteFocus` (focus moves to `main` after a page change) and `NavigationBar`/`Footer` with a real router (`aria-current`, link targets).
|
|
|
|
## Build-level checks (run after `pnpm build` + `pnpm preview`)
|
|
|
|
| Check | How | Expected |
|
|
|---|---|---|
|
|
| Deep link served | `curl -s -o /dev/null -w "%{http_code}" http://localhost:4173/portfolio` | `200` (SPA fallback) |
|
|
| Sitemap | `curl http://localhost:4173/sitemap.xml` | `200`, `text/xml`, only `https://andreaslop.nl/` |
|
|
| Robots | `curl http://localhost:4173/robots.txt` | `200`, points to the sitemap |
|
|
| E-mail address not in build | `grep -rl "info@andreaslop" dist` | No result (BR-EMAIL-01) |
|
|
| No devtools in build | `ls dist/assets \| grep -i devtool` | No result (NFR-P-04) |
|
|
|
|
## Setup and cleanup
|
|
- **Setup**: no services. The automated tests use an in-memory router history and jsdom.
|
|
- **Cleanup**: stop `pnpm preview` (Ctrl+C).
|