docs: make Related Stories plan executable
This commit is contained in:
1 file changed
+120
-62
@@ -14,7 +14,7 @@
|
||||
|
||||
- Work only in `/Users/chrnx/workspace/chrnx-dev/wp-theme/.worktrees/related-stories-layouts` on `feature/related-stories-layouts`.
|
||||
- Do not merge, push, deploy, publish, or mutate production content.
|
||||
- Use an isolated `wp-env`; do not stop or reuse the root environment on port 8888. Create an ignored temporary `.wp-env.override.json` with ports 8908/8909 and a temporary Playwright config outside the repository when browser verification begins.
|
||||
- Use an isolated `wp-env`; do not stop or reuse the root environment on port 8888. Create the ignored `.wp-env.override.json` with ports 8908/8909 before the first test. Parameterize the tracked Playwright config with `CHRNX_E2E_BASE_URL`, defaulting to 8888, and pass `CHRNX_E2E_BASE_URL=http://localhost:8908` in every isolated browser/full-suite command.
|
||||
- Follow strict RED → GREEN. Every production behavior below must first fail for the intended reason.
|
||||
- Preserve `chrnx_get_related_post_ids()` topic → shared tags → recency semantics.
|
||||
- Never commit `node_modules`, Playwright reports, screenshots, temporary environment files, credentials, or seeded database state.
|
||||
@@ -31,6 +31,8 @@
|
||||
- `tests/smoke/theme-preference-contract.test.mjs` — static block asset/schema ownership contract.
|
||||
- `tests/e2e/global-setup.mjs` only if the existing idempotent fixture seed needs no-op-safe related-story guarantees.
|
||||
- `tests/fixtures/posts.json` only if deterministic five-related-story coverage cannot be formed from the existing twelve posts; keep the approved fixture count invariant unless a failing test proves expansion necessary.
|
||||
- `playwright.config.mjs` — environment-selectable base URL while preserving the default 8888 contract.
|
||||
- `scripts/seed-test-content.sh` and `scripts/seed-test-content.php` — local-only serial `related-1/2/4` scenarios, if the runtime partial-count RED requires them.
|
||||
|
||||
### Create
|
||||
|
||||
@@ -40,8 +42,61 @@
|
||||
- `tests/js/editor-related-posts.test.js` — registration, numeric coercion, allowlisting, and edit behavior.
|
||||
- `tests/js/related-posts.test.js` — initialization, navigation, focus, resize, failure, and cleanup behavior.
|
||||
- `tests/e2e/related-stories.spec.mjs` — real editor, frontend, responsive, accessibility, no-JS, and permalink coverage.
|
||||
- `tests/e2e/related-stories-scenarios.spec.mjs` — serial mutation scenarios that always restore default fixture state.
|
||||
- `tests/smoke/related-stories-contract.test.mjs` — metadata, CSS, localization, and forbidden-behavior checks.
|
||||
|
||||
## Task 0: Start and prove the isolated environment
|
||||
|
||||
**Files:**
|
||||
|
||||
- Create temporarily, never commit: `.wp-env.override.json`
|
||||
- Modify: `playwright.config.mjs`
|
||||
- Modify: `tests/smoke/e2e-harness.test.mjs`
|
||||
|
||||
- [ ] **Step 1: Write the failing environment-selection smoke test**
|
||||
|
||||
Require `playwright.config.mjs` to read `process.env.CHRNX_E2E_BASE_URL || 'http://localhost:8888'`, while retaining the existing serial scenario dependency project.
|
||||
|
||||
- [ ] **Step 2: Run RED**
|
||||
|
||||
```bash
|
||||
node --test tests/smoke/e2e-harness.test.mjs
|
||||
```
|
||||
|
||||
Expected: FAIL because the base URL is hardcoded.
|
||||
|
||||
- [ ] **Step 3: Parameterize the base URL and create the ignored override**
|
||||
|
||||
Apply the one-line config change, then create `.wp-env.override.json` with:
|
||||
|
||||
```json
|
||||
{
|
||||
"port": 8908,
|
||||
"testsPort": 8909
|
||||
}
|
||||
```
|
||||
|
||||
- [ ] **Step 4: Start, activate, install, and prove isolation**
|
||||
|
||||
```bash
|
||||
PATH=/opt/homebrew/opt/docker/bin:$PATH npx wp-env start --update
|
||||
PATH=/opt/homebrew/opt/docker/bin:$PATH npx wp-env run cli wp theme activate chrnx
|
||||
PATH=/opt/homebrew/opt/docker/bin:$PATH npm run composer -- install --no-interaction --prefer-dist
|
||||
PATH=/opt/homebrew/opt/docker/bin:$PATH npx wp-env run cli wp option get home
|
||||
curl -fsS -o /dev/null -w 'ROOT=%{http_code}\n' http://localhost:8888/
|
||||
curl -fsS -o /dev/null -w 'ISOLATED=%{http_code}\n' http://localhost:8908/
|
||||
```
|
||||
|
||||
Expected: home is `http://localhost:8908`; both HTTP probes are 200, proving the root environment remains available.
|
||||
|
||||
- [ ] **Step 5: Run GREEN and commit only tracked config/tests**
|
||||
|
||||
```bash
|
||||
node --test tests/smoke/e2e-harness.test.mjs
|
||||
git add playwright.config.mjs tests/smoke/e2e-harness.test.mjs
|
||||
git commit -m "test: parameterize CHRNX browser environment"
|
||||
```
|
||||
|
||||
## Task 1: Lock the dynamic block's server contract
|
||||
|
||||
**Files:**
|
||||
@@ -62,8 +117,6 @@ assert.deepEqual(metadata.attributes.limit, {
|
||||
assert.deepEqual(metadata.attributes.layout, {
|
||||
type: 'string', default: 'adaptive', enum: ['adaptive', 'grid', 'carousel'],
|
||||
});
|
||||
assert.equal(metadata.editorScript, 'file:../../assets/js/editor-related-posts.js');
|
||||
assert.equal(metadata.viewScript, 'file:../../assets/js/related-posts.js');
|
||||
```
|
||||
|
||||
Add PHPUnit data providers that render the block with malformed, missing, and valid attributes. Assert:
|
||||
@@ -89,11 +142,11 @@ node --test tests/smoke/related-stories-contract.test.mjs
|
||||
PATH=/opt/homebrew/opt/docker/bin:$PATH npm run test:php -- --filter 'BlockRenderingTest::test_related'
|
||||
```
|
||||
|
||||
Expected: smoke fails because `layout`, scripts, and enum are absent; PHPUnit fails because the renderer accepts 1–12 and always emits the old grid wrapper.
|
||||
Expected: smoke fails because `layout` and the limit enum are absent; PHPUnit fails because the renderer accepts 1–12 and always emits the old grid wrapper.
|
||||
|
||||
- [ ] **Step 3: Implement strict metadata and server rendering**
|
||||
|
||||
In `block.json`, replace the limit range with enum `[3,5]`, add `layout`, `editorScript`, and `viewScript`.
|
||||
In `block.json`, replace the limit range with enum `[3,5]` and add `layout`. Do not reference scripts that do not exist yet; Tasks 2 and 3 add their own metadata atomically with their tested implementation.
|
||||
|
||||
In `render.php`, allowlist with strict type checks:
|
||||
|
||||
@@ -157,43 +210,37 @@ Build a Jest fixture with minimal `wp.blocks`, `wp.blockEditor`, `wp.components`
|
||||
|
||||
- [ ] **Step 2: Write failing PHP asset tests**
|
||||
|
||||
In `EditorAssetsTest`, retrieve the registered `chrnx/related-posts` type after `init`. Assert that its editor and view handles resolve to local theme files, the editor dependencies exactly match the asset manifest, translations use `chrnx`, and the block remains registered when current screen is `post`, `site-editor`, or absent.
|
||||
In `EditorAssetsTest`, retrieve the registered `chrnx/related-posts` type after `init`. Assert that its editor handle resolves to the local theme file, its dependencies exactly match the asset manifest, translations use `chrnx`, and the block remains registered when current screen is `post`, `site-editor`, or absent. Task 3 owns and tests `viewScript` atomically with the file it references.
|
||||
|
||||
- [ ] **Step 3: Run focused RED tests**
|
||||
- [ ] **Step 3: Write failing real-editor tests before implementation**
|
||||
|
||||
Create `tests/e2e/related-stories.spec.mjs`. Log in locally, open `/wp-admin/post-new.php`, and assert that Related Posts is recognized/insertable and exposes both inspector controls. Open `/wp-admin/site-editor.php`, edit the Single template, select its Related Posts block, choose five/carousel, and inspect editor state to require numeric `5`, allowlisted `carousel`, and null saved HTML. Never save or publish.
|
||||
|
||||
- [ ] **Step 4: Run focused RED tests**
|
||||
|
||||
```bash
|
||||
npm run test:js -- --runTestsByPath tests/js/editor-related-posts.test.js
|
||||
PATH=/opt/homebrew/opt/docker/bin:$PATH npm run test:php -- --filter 'EditorAssetsTest.*related'
|
||||
CHRNX_E2E_BASE_URL=http://localhost:8908 npx playwright test tests/e2e/related-stories.spec.mjs --project=chromium --grep 'post editor|Site Editor'
|
||||
```
|
||||
|
||||
Expected: Jest fails because the editor module does not exist; PHPUnit fails because no editor asset metadata exists.
|
||||
Expected: Jest fails because the editor module does not exist; PHPUnit fails because no editor asset metadata exists; both browser cases fail because WordPress 6.9.6 has no registered client block.
|
||||
|
||||
- [ ] **Step 4: Implement the client block**
|
||||
- [ ] **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`.
|
||||
|
||||
- [ ] **Step 5: Run focused GREEN tests and lint**
|
||||
- [ ] **Step 6: Run focused GREEN tests, editors, and lint**
|
||||
|
||||
```bash
|
||||
npm run test:js -- --runTestsByPath tests/js/editor-related-posts.test.js
|
||||
PATH=/opt/homebrew/opt/docker/bin:$PATH npm run test:php -- --filter 'EditorAssetsTest.*related'
|
||||
CHRNX_E2E_BASE_URL=http://localhost:8908 npx playwright test tests/e2e/related-stories.spec.mjs --project=chromium --grep 'post editor|Site Editor'
|
||||
npm run lint:js -- --max-warnings=0
|
||||
PATH=/opt/homebrew/opt/docker/bin:$PATH npm run phpcs
|
||||
```
|
||||
|
||||
Expected: all commands PASS with numeric `5` persisted and no global errors.
|
||||
|
||||
- [ ] **Step 6: Prove real post and Site Editor availability**
|
||||
|
||||
Start the isolated environment, seed it, and add Playwright tests that log in locally, open `/wp-admin/post-new.php`, insert/select Related Posts, and verify both controls. Then open `/wp-admin/site-editor.php`, edit the Single template, select its existing Related Posts block, choose five/carousel, and verify the serialized block attributes through editor state without saving or publishing.
|
||||
|
||||
Run with a temporary Playwright config whose `baseURL` is `http://localhost:8908`:
|
||||
|
||||
```bash
|
||||
npx playwright test tests/e2e/related-stories.spec.mjs --project=chromium --grep 'post editor|Site Editor'
|
||||
```
|
||||
|
||||
Expected: 2 tests PASS; no save/publish action occurs.
|
||||
Expected: all commands PASS with numeric `5` persisted, two real editor cases green, and no save/publish action or global errors.
|
||||
|
||||
- [ ] **Step 7: Commit Task 2**
|
||||
|
||||
@@ -208,6 +255,9 @@ git commit -m "feat: add Related Stories editor controls"
|
||||
|
||||
- Create: `assets/js/related-posts.js`
|
||||
- Create: `tests/js/related-posts.test.js`
|
||||
- Modify: `blocks/related-posts/block.json`
|
||||
- Modify: `tests/php/EditorAssetsTest.php`
|
||||
- Modify: `tests/smoke/related-stories-contract.test.mjs`
|
||||
- Modify: `blocks/related-posts/render.php` only if the RED test proves a missing data hook
|
||||
|
||||
- [ ] **Step 1: Write failing controller tests**
|
||||
@@ -228,22 +278,28 @@ Create real DOM fixtures for two block instances. Inject matchMedia and element
|
||||
- reinitialization does not duplicate listeners; cleanup removes every listener;
|
||||
- no timers, autoplay, clones, globals, link rewriting, or network APIs are used.
|
||||
|
||||
Add RED smoke/PHP assertions that `viewScript` equals the exact local controller path and its registered handle resolves to that existing file only when the block metadata is registered.
|
||||
|
||||
- [ ] **Step 2: Run controller RED**
|
||||
|
||||
```bash
|
||||
npm run test:js -- --runTestsByPath tests/js/related-posts.test.js
|
||||
node --test tests/smoke/related-stories-contract.test.mjs
|
||||
PATH=/opt/homebrew/opt/docker/bin:$PATH npm run test:php -- --filter 'EditorAssetsTest.*related.*view'
|
||||
```
|
||||
|
||||
Expected: FAIL because `assets/js/related-posts.js` is missing.
|
||||
Expected: FAIL because `assets/js/related-posts.js` and the atomic `viewScript` metadata are missing.
|
||||
|
||||
- [ ] **Step 3: Implement the smallest controller**
|
||||
|
||||
Use an IIFE with an exported CommonJS test surface only when `module.exports` exists, matching the repository's navigation/theme pattern. Initialize on DOM ready, scope queries to each section, use a `MediaQueryList`, calculate `card.getBoundingClientRect().width + parseFloat(getComputedStyle(track).columnGap || getComputedStyle(track).gap)`, update edge state from `scrollLeft`, `clientWidth`, and `scrollWidth`, and return cleanup callbacks. Reveal controls only after all requirements pass.
|
||||
Use an IIFE with an exported CommonJS test surface only when `module.exports` exists, matching the repository's navigation/theme pattern. Initialize on DOM ready, scope queries to each section, use a `MediaQueryList`, calculate `card.getBoundingClientRect().width + parseFloat(getComputedStyle(track).columnGap || getComputedStyle(track).gap)`, update edge state from `scrollLeft`, `clientWidth`, and `scrollWidth`, and return cleanup callbacks. Reveal controls only after all requirements pass. Add `viewScript` in the same change so metadata never references a missing file.
|
||||
|
||||
- [ ] **Step 4: Run controller GREEN and full JavaScript suite**
|
||||
|
||||
```bash
|
||||
npm run test:js -- --runTestsByPath tests/js/related-posts.test.js
|
||||
node --test tests/smoke/related-stories-contract.test.mjs
|
||||
PATH=/opt/homebrew/opt/docker/bin:$PATH npm run test:php -- --filter 'EditorAssetsTest.*related.*view'
|
||||
npm run test:js
|
||||
npm run lint:js -- --max-warnings=0
|
||||
```
|
||||
@@ -253,7 +309,7 @@ Expected: focused and full Jest suites PASS; lint exits 0.
|
||||
- [ ] **Step 5: Commit Task 3**
|
||||
|
||||
```bash
|
||||
git add assets/js/related-posts.js tests/js/related-posts.test.js blocks/related-posts/render.php
|
||||
git add assets/js/related-posts.js tests/js/related-posts.test.js blocks/related-posts/block.json blocks/related-posts/render.php tests/php/EditorAssetsTest.php tests/smoke/related-stories-contract.test.mjs
|
||||
git commit -m "feat: enhance Related Stories carousels"
|
||||
```
|
||||
|
||||
@@ -277,44 +333,33 @@ node --test tests/smoke/related-stories-contract.test.mjs
|
||||
|
||||
Expected: FAIL because `style.css` contains only card-media fallback rules.
|
||||
|
||||
- [ ] **Step 3: Implement CSS layout and controls**
|
||||
- [ ] **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.
|
||||
|
||||
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.
|
||||
|
||||
```bash
|
||||
CHRNX_E2E_BASE_URL=http://localhost:8908 npx playwright test tests/e2e/related-stories.spec.mjs --project=chromium --grep 'layout matrix'
|
||||
```
|
||||
|
||||
Expected: FAIL because production CSS does not implement the selected layouts.
|
||||
|
||||
- [ ] **Step 4: Implement CSS layout and controls**
|
||||
|
||||
Use block-local custom properties for gap and card basis. Grid modes use `repeat(min(3, item-count), minmax(0,1fr))` behavior through safe selectors/classes or auto-fit with a tested minimum; do not rely on unsupported generated CSS. Rails use flex, native overflow, snap, overscroll containment, and stable scrollbar space when supported. Preserve card heights through stretch alignment and set `min-width:0` on content. Style buttons from theme tokens with 45px targets and existing focus contrast.
|
||||
|
||||
- [ ] **Step 4: Run smoke/CSS GREEN**
|
||||
- [ ] **Step 5: Run static and runtime GREEN**
|
||||
|
||||
```bash
|
||||
node --test tests/smoke/related-stories-contract.test.mjs
|
||||
npm run lint:css -- --max-warnings=0
|
||||
CHRNX_E2E_BASE_URL=http://localhost:8908 npx playwright test tests/e2e/related-stories.spec.mjs --project=chromium --grep 'layout matrix'
|
||||
git diff --check
|
||||
```
|
||||
|
||||
Expected: all PASS.
|
||||
|
||||
- [ ] **Step 5: Add runtime layout matrix before adjusting production CSS**
|
||||
|
||||
Extend Playwright to create 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. Also exercise adaptive one/two/four availability fixtures without changing production query semantics.
|
||||
|
||||
Assert:
|
||||
|
||||
- exact card counts and grid column counts;
|
||||
- controls visible only for active rails;
|
||||
- desktop carousel card width equals `(track - 2 gaps)/3 ±2px`;
|
||||
- mobile card width equals the specified formula ±2px;
|
||||
- next-card preview is at least 24px and no more than 25% when another card exists;
|
||||
- only the track overflows; root `scrollWidth <= clientWidth`;
|
||||
- card text is not clipped at 200% zoom;
|
||||
- section/cards/controls do not overlap;
|
||||
- Light/Dark text and focus contrast remain compliant.
|
||||
|
||||
Run:
|
||||
|
||||
```bash
|
||||
npx playwright test tests/e2e/related-stories.spec.mjs --project=chromium --grep 'layout matrix'
|
||||
```
|
||||
|
||||
Expected before final CSS tuning: at least one geometry assertion FAIL for the old layout. Adjust only block-local CSS, rerun until PASS.
|
||||
|
||||
- [ ] **Step 6: Commit Task 4**
|
||||
|
||||
```bash
|
||||
@@ -327,7 +372,12 @@ git commit -m "style: add Related Stories layouts"
|
||||
**Files:**
|
||||
|
||||
- Modify: `tests/e2e/related-stories.spec.mjs`
|
||||
- Create: `tests/e2e/related-stories-scenarios.spec.mjs`
|
||||
- Modify: `playwright.config.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
|
||||
- Modify as required by a valid RED: `assets/js/related-posts.js`, `blocks/related-posts/render.php`, `blocks/related-posts/style.css`
|
||||
|
||||
- [ ] **Step 1: Write failing browser acceptance tests**
|
||||
|
||||
@@ -343,24 +393,28 @@ 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.
|
||||
|
||||
- [ ] **Step 2: Run acceptance RED**
|
||||
|
||||
```bash
|
||||
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.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
|
||||
```
|
||||
|
||||
Expected: tests that require the new block behavior fail before final integration; fixture changes are authorized only if the permalink/count precondition itself fails.
|
||||
|
||||
- [ ] **Step 3: Make the minimum integration/fixture correction**
|
||||
|
||||
Prefer existing published fixtures. If five deterministic related posts are impossible, update existing fixture taxonomy/tag assignments without increasing the approved 7-page/12-post count, keep keys/slugs stable, and prove double-seed idempotency. Do not add test-only production URL rewriting.
|
||||
Prefer existing published fixtures. Add allowlisted local-only `related-1/2/4` scenarios to both seed entrypoints. Each scenario snapshots the owned fixtures, leaves the current fixture published, leaves exactly the requested number of eligible related fixtures published, and temporarily drafts only the remaining `_chrnx_fixture_key`-owned posts. The serial test restores `default` in `finally`; default republishes the declared fixture statuses. This keeps all scenario behavior inside local seed tooling and leaves the production selector untouched. If five deterministic related posts are impossible, update existing fixture taxonomy/tag assignments without increasing the approved 7-page/12-post count. Keep keys/slugs stable, seed twice, and prove the same 19 owned IDs and default fingerprint before/after serial scenarios. Do not add URL rewriting or test-only production hooks.
|
||||
|
||||
- [ ] **Step 4: Run Chromium GREEN, then all engines**
|
||||
|
||||
```bash
|
||||
npx playwright test tests/e2e/related-stories.spec.mjs --project=chromium
|
||||
npx playwright test tests/e2e/related-stories.spec.mjs --project=firefox
|
||||
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.spec.mjs --project=chromium
|
||||
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
|
||||
```
|
||||
|
||||
Expected: all behavior passes in Chromium, Firefox, and WebKit. Axe may remain intentionally Chromium-only and must be explicitly skipped elsewhere.
|
||||
@@ -368,7 +422,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/fixtures/posts.json tests/e2e/global-setup.mjs
|
||||
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 commit -m "test: verify Related Stories workflows"
|
||||
```
|
||||
|
||||
@@ -379,7 +433,7 @@ git commit -m "test: verify Related Stories workflows"
|
||||
- [ ] **Step 1: Run complete repository verification sequentially**
|
||||
|
||||
```bash
|
||||
PATH=/opt/homebrew/opt/docker/bin:$PATH npm test
|
||||
PATH=/opt/homebrew/opt/docker/bin:$PATH CHRNX_E2E_BASE_URL=http://localhost:8908 npm test
|
||||
```
|
||||
|
||||
Expected: smoke, JS/CSS lint, PHPCS, Jest, PHPUnit on `tests-cli`, and Playwright all PASS. Do not run PHPUnit and Playwright concurrently against shared state.
|
||||
@@ -389,10 +443,11 @@ Expected: smoke, JS/CSS lint, PHPCS, Jest, PHPUnit on `tests-cli`, and Playwrigh
|
||||
```bash
|
||||
PATH=/opt/homebrew/opt/docker/bin:$PATH npx wp-env run cli wp eval 'echo WP_Block_Type_Registry::get_instance()->is_registered("chrnx/related-posts") ? "RELATED_BLOCK=1\n" : "RELATED_BLOCK=0\n";'
|
||||
curl -fsS -o /tmp/chrnx-related-single.html -w 'HTTP=%{http_code}\n' http://localhost:8908/una-cuerda-rota-tambien-puede-decidir-el-arreglo/
|
||||
rg -n 'PHP Warning|PHP Fatal|Related stories|is-layout-adaptive' /tmp/chrnx-related-single.html
|
||||
rg -n 'Related stories|is-layout-adaptive' /tmp/chrnx-related-single.html
|
||||
if rg -n 'PHP (?:Warning|Fatal|Notice)|Fatal error' /tmp/chrnx-related-single.html; then exit 1; fi
|
||||
```
|
||||
|
||||
Expected: `RELATED_BLOCK=1`, HTTP 200, Related Stories markup present, and no PHP warning/fatal output.
|
||||
Expected: `RELATED_BLOCK=1`, HTTP 200, the positive markup search succeeds, and the negative error search finds nothing.
|
||||
|
||||
- [ ] **Step 3: Security and scope review**
|
||||
|
||||
@@ -402,6 +457,7 @@ 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.
|
||||
@@ -410,9 +466,11 @@ Expected: diff check clean; only intended files plus the ignored `node_modules`
|
||||
|
||||
```bash
|
||||
PATH=/opt/homebrew/opt/docker/bin:$PATH npx wp-env stop
|
||||
rm -f .wp-env.override.json
|
||||
rm -rf test-results playwright-report
|
||||
```
|
||||
|
||||
Expected: isolated 8908/8909 containers stop; root port 8888 remains untouched.
|
||||
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).
|
||||
|
||||
- [ ] **Step 5: Request spec and quality review**
|
||||
|
||||
|
||||
Reference in new issue
Block a user