docs: finalize Related Stories execution plan

This commit is contained in:
chrnx committed 2026-08-12 18:43:31 -05:00
1 parent e1f120d460
commit 5ff420145f
1 file changed
+10 -7
@@ -191,6 +191,7 @@ git commit -m "feat: configure Related Stories rendering"
- Create: `assets/js/editor-related-posts.js`
- Create: `assets/js/editor-related-posts.asset.php`
- Create: `tests/js/editor-related-posts.test.js`
- Modify: `blocks/related-posts/block.json`
- Modify: `tests/php/EditorAssetsTest.php`
- Modify: `tests/e2e/related-stories.spec.mjs`
@@ -228,7 +229,7 @@ Expected: Jest fails because the editor module does not exist; PHPUnit fails bec
- [ ] **Step 5: Implement the client block**
Create a no-JSX IIFE that validates required WordPress APIs, registers the dynamic block, creates two `SelectControl` components, and renders ServerSideRender. Use the exact numeric coercion and layout allowlist from the spec. Create the adjacent PHP asset manifest with local dependencies; do not enqueue it through `inc/editor.php`.
Create a no-JSX IIFE that validates required WordPress APIs, registers the dynamic block, creates two `SelectControl` components, and renders ServerSideRender. Use the exact numeric coercion and layout allowlist from the spec. Create the adjacent PHP asset manifest with local dependencies and atomically add `"editorScript":"file:../../assets/js/editor-related-posts.js"` to `block.json`; do not enqueue it through `inc/editor.php`.
- [ ] **Step 6: Run focused GREEN tests, editors, and lint**
@@ -245,7 +246,7 @@ Expected: all commands PASS with numeric `5` persisted, two real editor cases gr
- [ ] **Step 7: Commit Task 2**
```bash
git add assets/js/editor-related-posts.js assets/js/editor-related-posts.asset.php tests/js/editor-related-posts.test.js tests/php/EditorAssetsTest.php tests/e2e/related-stories.spec.mjs
git add assets/js/editor-related-posts.js assets/js/editor-related-posts.asset.php blocks/related-posts/block.json tests/js/editor-related-posts.test.js tests/php/EditorAssetsTest.php tests/e2e/related-stories.spec.mjs
git commit -m "feat: add Related Stories editor controls"
```
@@ -320,6 +321,7 @@ git commit -m "feat: enhance Related Stories carousels"
- Modify: `blocks/related-posts/style.css`
- Modify: `tests/smoke/related-stories-contract.test.mjs`
- Modify: `tests/e2e/related-stories.spec.mjs`
- Modify: `tests/fixtures/posts.json`
- [ ] **Step 1: Write failing static CSS contract tests**
@@ -335,7 +337,7 @@ Expected: FAIL because `style.css` contains only card-media fallback rules.
- [ ] **Step 3: Write the failing runtime layout matrix before CSS implementation**
Extend Playwright to render deterministic Related Stories variants locally through block attributes and seeded posts. Cover `3/5 × adaptive/grid/carousel` at 375, 768, 900, 901, 1440, and 2560 in Light and Dark. Partial-result mutation scenarios belong to the separate serial Task 5 project, not this parallel read-only matrix.
Before writing the browser test, add six identified Related Stories block instances to the stored content of the existing synthetic long-title fixture—one for each `3/5 × adaptive/grid/carousel` combination—wrapped in uniquely anchored groups. Keep the fixture count, key, slug, and published status unchanged. Global setup seeds this stable read-only route before all browser projects. Extend Playwright against that exact route at 375, 768, 900, 901, 1440, and 2560 in Light and Dark. Partial-result mutation scenarios belong to the separate serial Task 5 project, not this parallel read-only matrix.
Assert exact card counts and grid columns, active-rail control visibility, desktop/mobile card-width formulas, continuation preview bounds, track-only overflow, root containment, 200% text integrity, no intersections, and Light/Dark contrast.
@@ -363,7 +365,7 @@ Expected: all PASS.
- [ ] **Step 6: Commit Task 4**
```bash
git add blocks/related-posts/style.css tests/smoke/related-stories-contract.test.mjs tests/e2e/related-stories.spec.mjs
git add blocks/related-posts/style.css tests/smoke/related-stories-contract.test.mjs tests/e2e/related-stories.spec.mjs tests/fixtures/posts.json
git commit -m "style: add Related Stories layouts"
```
@@ -393,7 +395,7 @@ On a seeded single-post route containing the default block, add tests for:
- clicking each rendered related card reaches a same-origin published single-post response with HTTP 200 and no PHP warning;
- axe finds no automatically detectable WCAG 2.2 AA violations in grid and active carousel states.
Create the mutation spec before changing the seed. It requests local scenarios `related-1`, `related-2`, and `related-4`, asserts exact rendered counts, and restores `default` in both `finally` and `afterAll`. Add a dedicated Playwright `related-scenarios` project with `workers:1`, `fullyParallel:false`, dependencies on every read-only browser project, and `testMatch:'related-stories-scenarios.spec.mjs'`. Every reader project ignores this mutation spec.
Create the mutation spec before changing the seed. It requests local scenarios `related-1`, `related-2`, and `related-4`, asserts exact rendered counts, and restores `default` in both `finally` and `afterAll`. Add a dedicated Playwright `related-scenarios` project with `workers:1`, `fullyParallel:false`, `dependencies:['scenarios']`, and `testMatch:'related-stories-scenarios.spec.mjs'`. The existing `scenarios` project already depends on every read-only browser project, so this explicit chain guarantees the two database-mutating projects never overlap. Every reader project and the existing `scenarios` project ignore the new mutation spec; `related-scenarios` ignores the older mutation spec.
- [ ] **Step 2: Run acceptance RED**
@@ -457,10 +459,9 @@ Inspect the complete branch diff. Confirm strict attribute allowlists, escaped o
git diff main...HEAD --check
git status --short
git diff --stat main...HEAD
test ! -e test-results && test ! -e playwright-report
```
Expected: diff check clean; only intended files plus the ignored `node_modules` symlink if present; no temporary environment/config/report artifacts.
Expected: diff check clean; only intended files plus ignored temporary artifacts identified for deletion in Step 4.
- [ ] **Step 4: Stop only the isolated environment**
@@ -468,6 +469,8 @@ Expected: diff check clean; only intended files plus the ignored `node_modules`
PATH=/opt/homebrew/opt/docker/bin:$PATH npx wp-env stop
rm -f .wp-env.override.json
rm -rf test-results playwright-report
test ! -e .wp-env.override.json && test ! -e test-results && test ! -e playwright-report
git status --short --ignored
```
Expected: isolated 8908/8909 containers stop; root port 8888 remains untouched; ignored override/reports are gone. Re-run `git status --short --ignored` and confirm no temporary configuration/report artifact remains (an ignored `node_modules/` entry is expected).