Skip to content

test(hot): reach 100% of the client, off the deprecated statsOptions - #2402

Merged
alexander-akait merged 1 commit into
mainfrom
test/hot-client-coverage
Sep 2, 2026
Merged

test(hot): reach 100% of the client, off the deprecated statsOptions#2402
alexander-akait merged 1 commit into
mainfrom
test/hot-client-coverage

Conversation

@alexander-akait

@alexander-akait alexander-akait commented Sep 2, 2026

Copy link
Copy Markdown
Member

Summary

The overlay's payload test drove hot.statsOptions, which is deprecated and should not be what a test documents; it now sets stats: "errors-only", the option that governs this since #2392. That needed a stats passthrough in the e2e helper.

Three more browser cases close what was reachable in client-src: restyling a card that is already open, an empty problem string through the HTML encoder, and Escape pressed inside the overlay frame rather than on the host page. What remains cannot be produced from a browser, so it carries an istanbul ignore with the reason instead of a contrived test — paging and rendering without a problem set, a label the document-less guard already covers, hot.check() rejecting while the runtime is in abort/fail, an applied update that renews nothing, and an error event queued behind close().

client-src goes from 97.88% to 100% of statements and 89.26% to 92.23% of branches, measured from the browser suite alone.

What kind of change does this PR introduce?

test

Did you add tests for your changes?

Yes — three cases in test/e2e/overlay.test.js, plus the converted payload test.

Does this PR introduce a breaking change?

No.

If relevant, what needs to be documented once your changes are merged or what have you already documented?

n/a

Use of AI

AI was used. Claude Code converted the deprecated-option test, wrote the three browser cases, classified the remaining branches as reachable or not, and drafted this description; every number above comes from running the suite.

🤖 Generated with Claude Code

https://claude.ai/code/session_01KUpsHWHZG2FxHzJxRUvVv3


Generated by Claude Code

Summary by CodeRabbit

  • Bug Fixes

    • Improved coverage around error handling, disconnects, and overlay rendering paths.
    • Verified that open overlay cards can be restyled, empty problem states render safely, and Escape dismisses the overlay when focus is inside an iframe.
    • Updated warning filtering coverage to use the top-level stats: "errors-only" configuration.
  • Tests

    • Expanded end-to-end coverage for overlay behavior and warning payloads.

The overlay's payload test drove hot.statsOptions, which is deprecated
and must not be what a test documents. It now sets stats: "errors-only",
the option that governs this, which needed a stats passthrough in the e2e
helper.

Three more browser cases close what was reachable: restyling a card that
is already open, an empty problem string through the encoder, and Escape
pressed inside the overlay frame rather than on the host page.

What is left cannot be produced from a browser, so it is marked with the
reason rather than faked: paging and rendering without a problem set, a
label the document-less guard already covers, hot.check() rejecting while
the runtime is in abort/fail, an applied update that renews nothing, and
an error event queued behind close(). client-src is at 100% of statements
and 92.23% of branches.
@changeset-bot

changeset-bot Bot commented Sep 2, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 9fd9ae9

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai

coderabbitai Bot commented Sep 2, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: c2d222c2-5165-4ecf-bb0a-7ffe9a13c663

📥 Commits

Reviewing files that changed from the base of the PR and between 17e689e and 9fd9ae9.

📒 Files selected for processing (7)
  • client-src/index.js
  • client-src/indicator.js
  • client-src/overlay.js
  • client-src/process-update.js
  • test/e2e/__snapshots__/overlay.test.js.snap.webpack5
  • test/e2e/overlay.test.js
  • test/helpers/hot-app.js

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.


Walkthrough

The change adds Istanbul coverage exclusions and explanatory comments to client-side guard branches without changing runtime behavior. The test helper now forwards an optional stats configuration. The warning-filtering test uses stats: "errors-only". New end-to-end tests cover live restyling, empty problem messages, and Escape-based overlay dismissal.

Merge Risk: ⚪ Minimal · up to 9fd9a

This PR updates browser coverage and test configuration without changing production behavior or public APIs, so no actionable merge-blocking risk remains after normal checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: increasing client coverage to 100% and replacing deprecated hot.statsOptions usage.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 6 files. (1 skipped: 1 …
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 6 files. (1 skipped: 1 unsupported.)

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch test/hot-client-coverage

Warning

Some tools did not complete. Review the errors below.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install failed: dependency version conflict. Check your lock file or package.json.


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.

@codecov

codecov Bot commented Sep 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.09%. Comparing base (17e689e) to head (9fd9ae9).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2402      +/-   ##
==========================================
+ Coverage   96.35%   97.09%   +0.73%     
==========================================
  Files          12       12              
  Lines        1675     1653      -22     
==========================================
- Hits         1614     1605       -9     
+ Misses         61       48      -13     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@alexander-akait
alexander-akait merged commit e58a70b into main Sep 2, 2026
22 checks passed
@alexander-akait
alexander-akait deleted the test/hot-client-coverage branch September 2, 2026 19:13
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