Commit a9f755c
test(kernel-ui): Robustify SendMessageForm tests (#924)
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.
<!-- CURSOR_SUMMARY -->
---
> [!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.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
3572568. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent 9050993 commit a9f755c
1 file changed
Lines changed: 2 additions & 3 deletions
Lines changed: 2 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
| 112 | + | |
112 | 113 | | |
113 | 114 | | |
114 | 115 | | |
| |||
203 | 204 | | |
204 | 205 | | |
205 | 206 | | |
206 | | - | |
207 | | - | |
208 | 207 | | |
209 | 208 | | |
210 | 209 | | |
| |||
0 commit comments