Skip to content

test(comments): cover the list_controller.notifyProgrammaticScroll seam#1408

Open
sh1nj1 wants to merge 1 commit into
mainfrom
fix/list-controller-notify-seam-coverage
Open

test(comments): cover the list_controller.notifyProgrammaticScroll seam#1408
sh1nj1 wants to merge 1 commit into
mainfrom
fix/list-controller-notify-seam-coverage

Conversation

@sh1nj1

@sh1nj1 sh1nj1 commented Jul 20, 2026

Copy link
Copy Markdown
Owner

Follow-up to #1407 — closes a real codecov patch-coverage gap

Codecov flagged uncovered patch lines in list_controller.js on #1407. Investigating the diff against istanbul line data, the one genuinely uncovered new line was the public notifyProgrammaticScroll() seam (line 358).

Root cause

The seam's only exercise is form_controller_review.test.js, which mocks the list controller:

jest.spyOn(controller, 'listController', 'get').mockReturnValue({ notifyProgrammaticScroll })

That correctly unit-tests form_controller (it should not reach into the real navigator), but it means the real delegating seam on list_controller never ran under test — so it showed as uncovered.

Fix

A direct test that drives the real seam through the existing controller harness (buildController) and asserts it drops the anchor, mirroring the existing permalink-jump test.

  • DA:358 goes 0 → 1 (verified in lcov).
  • Mutation-checked: neutering the seam body fails only this new test (1 failed, 15 passed), so it detects behavior, not just line execution.
  • Full JS suite 657/657, npm run build clean.

Test-only change; no production code touched.

Codecov flagged uncovered patch lines in list_controller.js on #1407. The
one genuinely uncovered new line was the public notifyProgrammaticScroll()
seam (line 358): its only exercise, form_controller_review.test.js, mocks
the list controller (mockReturnValue({ notifyProgrammaticScroll })), so the
real delegating method never ran.

Add a direct test that drives the real seam through the existing controller
harness and asserts it drops the anchor, mirroring the permalink-jump test.
Mutation-checked: neutering the seam fails only this test.

Full JS suite 657/657, build clean.
Copilot AI review requested due to automatic review settings July 20, 2026 22:22

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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.

3 participants