docs(requirements): split test inspector contract
Split the oversized test/001 row into test backend, inspector assertions, canonical assertion style, and browser selector adapter requirements. req: test/001 req: test/007 req: test/008 req: test/009
This commit is contained in:
@@ -52,6 +52,7 @@ Keep it stable. Prefer pointers to canonical sources over copied structure, file
|
||||
- Prefer links or pointers to canonical sources over copied lists.
|
||||
- Avoid project trees, architecture maps, generated inventories, current file sizes, issue lists, TODO inventories, and other snapshots that will rot.
|
||||
- Stable commands: `cargo run -p hemx-xtask -- test`, `cargo run -p hemx-xtask -- html-examples-smoke`, `cargo check --workspace`, `redgate health --strict`. Use the xtask runner for full verification so jobs are capped from local CPU and memory; use the html_examples smoke for focused browser verification of the HTML pattern gallery. req: test/004 req: test/006
|
||||
- Example behavior tests should prefer `hemx_test` generated-resource assertions over raw slot constants or raw effect/payload matching. req: test/008
|
||||
- Run the workout product exemplar with `cargo run -p hemx-xtask -- workout dev` and open `http://127.0.0.1:3028`; set `HEMX_WORKOUT_ADDR=127.0.0.1:3030` if the default port is busy. Its durable visual direction and recovery expectations live in `examples/workout/DESIGN.md`. req: examples/001
|
||||
- Use the same Workout command surface for tests, production build, and mobile release: `cargo run -p hemx-xtask -- workout test`, `cargo run -p hemx-xtask -- workout build`, `HEMX_WORKOUT_ORIGIN=https://workout.example.com cargo run -p hemx-xtask -- workout mobile-release`, and `HEMX_WORKOUT_ORIGIN=https://workout.example.com cargo run -p hemx-xtask -- workout mobile-verify`; Android/iOS SDKs, store submission targets, and signing remain external blockers, not repo-owned secrets. req: examples/006
|
||||
- hemx core stays small: effects, typed ids, registries, and wire schema only.
|
||||
|
||||
+10
-1
@@ -722,7 +722,16 @@ what a valid business email is.
|
||||
## test
|
||||
|
||||
### req: test/001
|
||||
001 `EffectWriter` implements a test backend so handlers can be unit-tested without a browser: `hemx_test::run(handler, input)`, `hemx_test::inspect_batch(dispatched_batch)`, and `hemx_test::inspect_wire(bytes)` return an `EffectInspector` with generated-resource assertions such as `has_target(generated_target)`, `updates_text(generated_target)`, `updates_html(generated_target)`, `target_html_containing(generated_target, text)`, `inserts_html_containing(generated_target, key, text)`, `replaces_keyed_html_containing(generated_target, key, text)`, `removes_key(generated_target, key)`, `pushes_to(url)`, `emits(name, payload)`, `emits_containing(name, text)`, `has_slot(slot)`, `has_atom(atom)`, etc. Canonical example tests should prefer generated-target assertions so tests use the same generated target objects as handlers instead of importing raw slot constants or matching raw effects/payloads. Browser/E2E selector helpers are allowed only as low-level test adapters for driving rendered HTML and must be generated or named around public authoring concepts such as handles, targets, forms, nav links, roots, islands, class tokens, or keys; they must not become app authoring APIs or teach selector targeting.
|
||||
001 `EffectWriter` implements a test backend so handlers can be unit-tested without a browser through `hemx_test` run and inspect helpers. [north_star]
|
||||
|
||||
### req: test/007
|
||||
007 `EffectInspector` exposes generated-resource assertions for target updates, HTML/text payloads, keyed insert/replace/remove, navigation, emitted events, slots, and atoms. [north_star]
|
||||
|
||||
### req: test/008
|
||||
008 Canonical example tests prefer generated-target assertions so tests use the same generated target objects as handlers instead of importing raw slot constants or matching raw effects/payloads. [north_star]
|
||||
|
||||
### req: test/009
|
||||
009 Browser/E2E selector helpers are low-level test adapters only; they are generated or named around public authoring concepts such as handles, targets, forms, nav links, roots, islands, class tokens, or keys, and must not become app authoring APIs. [north_star]
|
||||
|
||||
### req: test/002
|
||||
002 `#[hemx::component]` may compile without generated Surface files for incremental module-local testing. `#[hemx::surface]` requires `hemx.generated.rs` in `$OUT_DIR` and fails with an actionable diagnostic when generation is missing, because it is the public generated API bridge.
|
||||
|
||||
Reference in New Issue
Block a user