Skip to content

[Remove] brittle renderer source-text tests - #434

Merged
juanmaguitar merged 1 commit into
trunkfrom
juanmaguitar/cleanup-426
Sep 11, 2026
Merged

juanmaguitar merged 1 commit into
trunkfrom
juanmaguitar/cleanup-426

Conversation

@juanmaguitar

Copy link
Copy Markdown
Collaborator

Why

These tests inspect raw src/renderer/index.jsx text, so harmless JSX restructuring can fail the suite without changing user-facing behavior. Issue #426 keeps the directly testable renderer decisions covered through their pure modules instead.

What changes

Remove source-text assertions from the site URL, changes note, and PR-state unit suites, along with imports used only by those assertions. Direct behavior tests for site-urls.cjs, changes-note.cjs, and pr-state.cjs remain; no production code changes.

How to test this

Platforms: any — this changes unit-test coverage only and has no user-visible surface.

Starting state:

  1. Check out this branch with dependencies installed.
  2. Run node --test tests/unit/site-urls.test.cjs tests/unit/changes-note.test.cjs tests/unit/pr-state.test.cjs.
  3. Run npm run lint and npm test.

Expected result:

The focused suite reports 34 passing tests, lint succeeds, and the full suite succeeds.

What must not have happened:

The pure-function behavior checks for URL construction, discard-note state, and PR badge state must not be removed. No application code or other test suites should change.

Risks and limitations

No self-review findings. This intentionally stops checking index.jsx call-site structure and link/control placement by literal source text; the retained tests validate the pure renderer decisions those source-text checks duplicated. No manual UI test applies because there is no user-visible change.

Related

Fixes #426


Design decisions and alternatives considered

Removed only the tests that read index.jsx as text (including literal counts, ordering, and regex checks). Kept tests that call pure helper functions directly, because they exercise behavior rather than implementation spelling or layout.

Review outcome (required — see AGENTS.md)

0 [fix here] · 0 [follow-up]. Reviewed the deletion-only diff across architecture, security, performance, cross-platform behavior, and test coverage after npm run lint and npm test; no findings.

Implementation notes

Removed 125 lines across tests/unit/site-urls.test.cjs, tests/unit/changes-note.test.cjs, and tests/unit/pr-state.test.cjs. The branch commit is 73eb662.

@coderabbitai

coderabbitai Bot commented Sep 10, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: db4b64d5-0ab7-436e-b2c8-cc1e7efa1bf9

📥 Commits

Reviewing files that changed from the base of the PR and between fd83488 and 73eb662.

📒 Files selected for processing (3)
  • tests/unit/changes-note.test.cjs
  • tests/unit/pr-state.test.cjs
  • tests/unit/site-urls.test.cjs
💤 Files with no reviewable changes (3)
  • tests/unit/site-urls.test.cjs
  • tests/unit/changes-note.test.cjs
  • tests/unit/pr-state.test.cjs

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The test suite removes brittle index.jsx source-inspection tests from three unit test files. It also removes unused fs and path imports and related constants. Direct tests for changes notes, pull request state badges, and site URL functions remain.

Assessment against linked issues

Objective Addressed Explanation
Remove raw index.jsx source-inspection tests while retaining direct pure-function tests [#426] ✅
Make no production changes [#426] ✅
Ensure npm run lint and npm test pass [#426] ❓ The provided change summary does not include command results.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to c5086

This test-only cleanup removes brittle renderer source assertions while preserving direct behavior tests; no production or user-visible behavior changes are indicated.

🚥 Pre-merge checks | ✅ 3 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The pull request title was not provided, so compliance with the required [Action] [what] [where or why] format cannot be verified. Provide the pull request title and verify that it follows the required [Action] [what] [where or why] format.
✅ Passed checks (3 passed)
Check name Status Explanation
Description check ✅ Passed The description covers the rationale, changes, testing, risks, related issue, decisions, review outcome, and implementation notes. It does not identify the reviewer or reviewed base SHA, but it is oth…
Linked Issues check ✅ Passed The changes match issue #426: they remove the specified source-inspection tests, retain pure-function tests, and make no production changes.
Out of Scope Changes check ✅ Passed The diff is limited to the three specified unit test files. No production code or unrelated test suites changed.

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

Comment @coderabbitai help to get the list of available commands.

@juanmaguitar juanmaguitar added the audit-code Follow-up work from the codebase audit label Sep 10, 2026
@juanmaguitar

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 10, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@juanmaguitar
juanmaguitar force-pushed the juanmaguitar/cleanup-426 branch from 73eb662 to c9c4d6e Compare September 11, 2026 03:53
@juanmaguitar
juanmaguitar force-pushed the juanmaguitar/cleanup-426 branch from c9c4d6e to c508697 Compare September 11, 2026 04:00
@juanmaguitar
juanmaguitar merged commit d1e7f36 into trunk Sep 11, 2026
8 checks passed
@juanmaguitar
juanmaguitar deleted the juanmaguitar/cleanup-426 branch September 11, 2026 04:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

audit-code Follow-up work from the codebase audit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove brittle source-text tests for links and shared controls

1 participant