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:
+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