Skip to content

test(components): move the last component tests off react-test-renderer and drop it - #4831

Open
devswha wants to merge 5 commits into
test/react-dom-tests-components-1from
test/react-dom-tests-components-3
Open

devswha wants to merge 5 commits into
test/react-dom-tests-components-1from
test/react-dom-tests-components-3

Conversation

@devswha

@devswha devswha commented Nov 26, 2026 •

Copy link
Copy Markdown
Owner

What

Last of four PRs moving the src/ tests off the deprecated react-test-renderer (after #4815 and #4816, merged, and #4829). Stacked on #4829: retarget to main after it merges. It moves the 37 component tests from PromptCard to review-client-p12, plus MachineDialog.progress (#4811), RelayPanel.compact (#4615) and FileViewer.save (#4073), all added on react-test-renderer while this series was under way,, to the happy-dom page and removes react-test-renderer and @types/react-test-renderer from package.json and bun.lock. Nothing in the repository names react-test-renderer any more.

Test meaning

Every file keeps its test names, order and test count (checked per file against origin/main); expect() counts are equal or higher where the review added checks. Across all 174 migrated files the series keeps 2742 tests, file for file the same as current main. Shifts worth a look:

  • StrictModePanel: nothing forbidden may show anywhere in the document, portals included (the old renderer drew portals inline).
  • WorktreeDialog: a fresh create request must start before the repository changes, and only that request is answered.
  • Visualization: pending work runs while the fake transport is installed before checking that no request went out.
  • RelayShell: three notice components are checked through DOM markers; link taps through defaultPrevented on the real click. Includes main's newer offline test from fix(relay): ask the account service before saying the device is offline #4810, and feat(relay): put the dash into a typed pairing code after the first five characters #4614's check that the pairing-code field is wired to typePairCode/endPairCodeComposition (read through the fixture's reactProps, as those are props the DOM cannot show; also in RelayShellScreens).
  • RelayPanel.compact: KeyId's id and label are read from its rendered group (role="group", aria-label, the group spans); the pairing window's CustomEvent announcements dispatch through the page's own event classes.
  • VoiceInput: fix(shortcuts): let Hold message in chat and Dictate (hold) be turned off #4793's shortcut test presses Ctrl+Shift+Space as real KeyboardEvents on the page's window.
  • TextFileEditor: the unsaved-changes warning is checked as a cancelled beforeunload event.

Validation

  • bun run typecheck: pass.
  • All 174 migrated files, one process per file, on this branch and on origin/main: 174/174 pass on both, 2742 tests on both, equal file for file. No file in the repository names react-test-renderer.
  • This PR's 37 files in one bun process: 735 pass, 0 fail. PortalAuth then SettingsControls in one process, both orders: pass (the order case the Codex review reproduced).
  • Codex adversarial review (gpt-6.2-sol-fast, xhigh) ran once on the whole series: 13 findings, all fixed in this series (see each PR).
  • Skipped locally: bun run check fast (this PC above 85% CPU); CI's Fast checks runs it.

No user-visible change, so no changelog fragment.

@coderabbitai

coderabbitai Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@devswha
devswha force-pushed the test/react-dom-tests-components-3 branch from bd5c07d to b017331 Compare November 26, 2026 18:49
…er and drop it

Last step: the 37 component tests from PromptCard to review-client-p12
render with react-dom into the happy-dom page (src/lib/page.fixture.ts) and
act through the DOM. No test imports react-test-renderer any more, so it and
@types/react-test-renderer leave package.json and bun.lock.

Each file keeps its test names, test count and expect() count; across all
171 migrated files that is 2725 tests, the same as before the series.
- RowMenu, RelayShell, RelayPairingPrompt: stub geometry on the page's own
  elements and restore the files' own globals in finally; the page restores
  shared prototypes.
- StrictModePanel: nothing forbidden may show anywhere in the document,
  portals included.
- WorktreeDialog: a fresh create request starts before the repository changes,
  and only that request is answered.
- Visualization: pending work runs while the fake transport is installed
  before checking that no request went out.
- VouchedPcApproval: put back the account module it mocks.
#4615 added this test on react-test-renderer while the migration was under way. Its
KeyId checks read the id and label from the rendered group, and the pairing window's
CustomEvent announcements dispatch through the page's own event classes.
#4073 added this test on react-test-renderer while the migration was under way. It
renders into the happy-dom page, presses Download as a real click, and gives the
home-screen cases the page navigator's standalone and share sheet.
@devswha
devswha force-pushed the test/react-dom-tests-components-1 branch from 67af8f5 to 6ad73a9 Compare November 26, 2026 19:28
@devswha
devswha force-pushed the test/react-dom-tests-components-3 branch from b017331 to 25ef895 Compare November 26, 2026 19:28

This branch has not been deployed

No deployments
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