docs: cover Related Stories scenario isolation

This commit is contained in:
chrnx committed 2026-08-12 18:45:23 -05:00
1 parent 5ff420145f
commit 6a131057d5
1 file changed
+7 -2
@@ -376,6 +376,7 @@ git commit -m "style: add Related Stories layouts"
- Modify: `tests/e2e/related-stories.spec.mjs`
- Create: `tests/e2e/related-stories-scenarios.spec.mjs`
- Modify: `playwright.config.mjs`
- Modify: `tests/smoke/e2e-harness.test.mjs`
- Modify: `scripts/seed-test-content.sh`
- Modify: `scripts/seed-test-content.php`
- Modify: `tests/fixtures/posts.json` and `tests/e2e/global-setup.mjs` only if a RED test proves existing fixtures cannot provide five deterministic related stories
@@ -397,14 +398,17 @@ On a seeded single-post route containing the default block, add tests for:
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.
Before implementation, extend `tests/smoke/e2e-harness.test.mjs` with a RED contract that recognizes exactly `visual-scenarios.spec.mjs` and `related-stories-scenarios.spec.mjs` as mutation specs, continues rejecting `seed-test-content`, `wp-env`, and `execFileSync` from every reader spec, and requires the dependency chain `chromium/firefox/webkit → scenarios → related-scenarios` with both mutation projects single-worker and non-parallel.
- [ ] **Step 2: Run acceptance RED**
```bash
CHRNX_E2E_BASE_URL=http://localhost:8908 npx playwright test tests/e2e/related-stories.spec.mjs --project=chromium --grep 'interaction|no JavaScript|permalink|accessibility'
CHRNX_E2E_BASE_URL=http://localhost:8908 npx playwright test tests/e2e/related-stories-scenarios.spec.mjs --project=related-scenarios
node --test tests/smoke/e2e-harness.test.mjs
```
Expected: tests that require the new block behavior fail before final integration; fixture changes are authorized only if the permalink/count precondition itself fails.
Expected: tests that require the new block behavior fail before final integration; harness smoke fails because the second mutation spec/project is not yet allowlisted and chained; fixture changes are authorized only if the permalink/count precondition itself fails.
- [ ] **Step 3: Make the minimum integration/fixture correction**
@@ -417,6 +421,7 @@ CHRNX_E2E_BASE_URL=http://localhost:8908 npx playwright test tests/e2e/related-s
CHRNX_E2E_BASE_URL=http://localhost:8908 npx playwright test tests/e2e/related-stories.spec.mjs --project=firefox
CHRNX_E2E_BASE_URL=http://localhost:8908 npx playwright test tests/e2e/related-stories.spec.mjs --project=webkit
CHRNX_E2E_BASE_URL=http://localhost:8908 npx playwright test tests/e2e/related-stories-scenarios.spec.mjs --project=related-scenarios
node --test tests/smoke/e2e-harness.test.mjs
```
Expected: all behavior passes in Chromium, Firefox, and WebKit. Axe may remain intentionally Chromium-only and must be explicitly skipped elsewhere.
@@ -424,7 +429,7 @@ Expected: all behavior passes in Chromium, Firefox, and WebKit. Axe may remain i
- [ ] **Step 5: Commit Task 5**
```bash
git add tests/e2e/related-stories.spec.mjs tests/e2e/related-stories-scenarios.spec.mjs playwright.config.mjs scripts/seed-test-content.sh scripts/seed-test-content.php tests/fixtures/posts.json tests/e2e/global-setup.mjs assets/js/related-posts.js blocks/related-posts/render.php blocks/related-posts/style.css
git add tests/e2e/related-stories.spec.mjs tests/e2e/related-stories-scenarios.spec.mjs playwright.config.mjs tests/smoke/e2e-harness.test.mjs scripts/seed-test-content.sh scripts/seed-test-content.php tests/fixtures/posts.json tests/e2e/global-setup.mjs assets/js/related-posts.js blocks/related-posts/render.php blocks/related-posts/style.css
git commit -m "test: verify Related Stories workflows"
```