test(kernel-ui): Robustify SendMessageForm tests#924
Merged
Conversation
…ilures Use resetMocks() in afterEach instead of manual restoration at the end of the test body, so a mid-test assertion failure cannot leave isKRefMock stuck at false for subsequent tests. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
8c0e69b to
3572568
Compare
sirtimid
approved these changes
Apr 8, 2026
Contributor
Coverage Report
File CoverageNo changed files found. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Use
resetMocks()inafterEachinstead of manual restoration at the end of the test body, so a mid-test assertion failure cannot leaveisKRefMockstuck at false for subsequent tests.Note
Low Risk
Low risk: changes are confined to a unit test file and only affect mock reset/cleanup behavior, not production logic.
Overview
Updates
SendMessageForm.test.tsxto destructure and callresetMocks()fromsetupOcapKernelMock()inafterEach, ensuring mock validation flags (e.g.,isKRef) are restored even if a test aborts early.Removes the in-test manual re-enabling of
isKRefin the KRef validation case, relying on centralized teardown for consistent test isolation.Reviewed by Cursor Bugbot for commit 3572568. Bugbot is set up for automated code reviews on this repo. Configure here.