Skip to content

test(kernel-ui): Robustify SendMessageForm tests#924

Merged
rekmarks merged 1 commit intomainfrom
rekm/fix-SendMessageForm-test
Apr 8, 2026
Merged

test(kernel-ui): Robustify SendMessageForm tests#924
rekmarks merged 1 commit intomainfrom
rekm/fix-SendMessageForm-test

Conversation

@rekmarks
Copy link
Copy Markdown
Member

@rekmarks rekmarks commented Apr 8, 2026

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.


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.tsx to destructure and call resetMocks() from setupOcapKernelMock() in afterEach, ensuring mock validation flags (e.g., isKRef) are restored even if a test aborts early.

Removes the in-test manual re-enabling of isKRef in 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.

@rekmarks rekmarks requested a review from a team as a code owner April 8, 2026 17:42
…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>
@rekmarks rekmarks force-pushed the rekm/fix-SendMessageForm-test branch from 8c0e69b to 3572568 Compare April 8, 2026 17:42
@rekmarks rekmarks enabled auto-merge April 8, 2026 17:43
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 8, 2026

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 78.6%
⬆️ +0.02%
8618 / 10963
🔵 Statements 78.41%
⬆️ +0.02%
8753 / 11162
🔵 Functions 76.15%
⬆️ +0.03%
2019 / 2651
🔵 Branches 76.24%
🟰 ±0%
3708 / 4863
File CoverageNo changed files found.
Generated in workflow #4241 for commit 3572568 by the Vitest Coverage Report Action

@rekmarks rekmarks added this pull request to the merge queue Apr 8, 2026
Merged via the queue into main with commit a9f755c Apr 8, 2026
33 checks passed
@rekmarks rekmarks deleted the rekm/fix-SendMessageForm-test branch April 8, 2026 17:55
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.

2 participants