Skip to content

test(core): add deterministic integration, resize/reflow, and stress-fuzz expansion#85

Merged
RtlZeroMemory merged 3 commits into
mainfrom
integration-tests
Feb 18, 2026
Merged

test(core): add deterministic integration, resize/reflow, and stress-fuzz expansion#85
RtlZeroMemory merged 3 commits into
mainfrom
integration-tests

Conversation

@RtlZeroMemory

Copy link
Copy Markdown
Owner

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:

  • VNode construction
  • commit + reconcile
  • layout
  • render + drawlist emission

New Test Suites

Integration (packages/core/src/__tests__/integration/)

  • integration.dashboard.test.ts — 25 tests
  • integration.form-editor.test.ts — 16 tests
  • integration.file-manager.test.ts — 16 tests
  • integration.resize.test.ts — 16 tests
  • integration.reflow.test.ts — 11 tests

Integration subtotal: 84 tests

Stress/Fuzz (packages/core/src/__tests__/stress/)

  • stress.rapid-events.test.ts — 6 tests
  • stress.large-trees.test.ts — 6 tests
  • fuzz.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

  • Uses deterministic harnessing with StubBackend + WidgetRenderer.
  • No real terminal usage.
  • No timing-dependent assertions.
  • Seeded RNG only in fuzz/stress (no Math.random()).
  • Fuzz and stress assertions fail loudly on crashes/invariant violations.

Fuzz Failure Reproduction

Fuzz tests encode seed and iteration context in test names and assertion context.

Examples:

  • Tree fuzz seeds: 0x7a11c0010x7a11c006
  • Event fuzz seeds: 0x6e7e10010x6e7e1006

To reproduce, rerun the corresponding fuzz test case and seed-specific test name.

Validation

  • npm run build
  • npm run typecheck
  • node scripts/run-tests.mjs

Current results:

  • Full suite: 3051 passed, 0 failed
  • Targeted new suites: 108 passed, 0 failed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +825 to +829
h.app.update((prev) => ({
...prev,
role: "pm",
plan: "pro",
}));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +844 to +847
h.app.update((prev) => ({
...prev,
newsletter: true,
}));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +615 to +619
h.app.update((prev) => ({
...prev,
confirmOpen: true,
submittedCount: prev.submittedCount + 1,
}));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@RtlZeroMemory
RtlZeroMemory merged commit b1361dc into main Feb 18, 2026
18 checks passed
@RtlZeroMemory
RtlZeroMemory deleted the integration-tests branch February 19, 2026 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant