test(core): add deterministic integration, resize/reflow, and stress-fuzz expansion#85
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bf692f052b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| h.app.update((prev) => ({ | ||
| ...prev, | ||
| role: "pm", | ||
| plan: "pro", | ||
| })); |
There was a problem hiding this comment.
Use routed events to set role/plan in routing test
This test is labeled as a routing check, but it updates role and plan via h.app.update(...) instead of driving the select/radio widgets through input events. Because the widget handlers are bypassed, regressions in focus/routing/selection logic for those controls would still pass this test, reducing the reliability of the integration suite.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Addressed in 8f949d3. The role/plan routing test now uses real routed key events (TAB focus + ArrowDown) to change select.role and radio.plan instead of mutating state via app.update.
| h.app.update((prev) => ({ | ||
| ...prev, | ||
| newsletter: true, | ||
| })); |
There was a problem hiding this comment.
Trigger newsletter toggle through Space key events
The test claims to validate checkbox toggling via Space, but it mutates newsletter directly with h.app.update(...) and never sends a Space key event to the checkbox. If keyboard routing or checkbox key handling breaks, this test will still pass and miss that user-visible regression.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Addressed in 8f949d3. The newsletter test now focuses check.newsletter via keyboard routing and toggles it with Space key events (ZR_KEY_SPACE) for both on/off assertions, with no direct state patching.
| h.app.update((prev) => ({ | ||
| ...prev, | ||
| confirmOpen: true, | ||
| submittedCount: prev.submittedCount + 1, | ||
| })); |
There was a problem hiding this comment.
Drive confirmation through submit action, not state patch
The helper used by submit-modal tests opens confirmation by directly setting confirmOpen and incrementing submittedCount, which bypasses the actual submit action path and its validation/routing behavior. As a result, submit-flow regressions can go undetected even though tests like valid submit opens confirmation modal appear to cover that behavior.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Addressed in 8f949d3. Confirmation opening is now driven through the real submit path: the helper navigates to review, focuses action.submit, and sends Enter. This validates routed submit behavior instead of forcing confirmOpen/submittedCount with app.update.
8f949d3 to
fe5faf7
Compare
Summary
This PR adds a deterministic full-pipeline integration and stress/fuzz test expansion for
@rezi-ui/core.New tests cover end-to-end behavior across:
New Test Suites
Integration (
packages/core/src/__tests__/integration/)integration.dashboard.test.ts— 25 testsintegration.form-editor.test.ts— 16 testsintegration.file-manager.test.ts— 16 testsintegration.resize.test.ts— 16 testsintegration.reflow.test.ts— 11 testsIntegration subtotal: 84 tests
Stress/Fuzz (
packages/core/src/__tests__/stress/)stress.rapid-events.test.ts— 6 testsstress.large-trees.test.ts— 6 testsfuzz.random-trees.test.ts— 6 tests (1024 iterations/test)fuzz.random-events.test.ts— 6 tests (1024 iterations/test)Stress/Fuzz subtotal: 24 tests
Total added in this PR: 108 deterministic tests
Determinism Approach
StubBackend+WidgetRenderer.Math.random()).Fuzz Failure Reproduction
Fuzz tests encode seed and iteration context in test names and assertion context.
Examples:
0x7a11c001…0x7a11c0060x6e7e1001…0x6e7e1006To reproduce, rerun the corresponding fuzz test case and seed-specific test name.
Validation
npm run buildnpm run typechecknode scripts/run-tests.mjsCurrent results: