Skip to content

The agent that grows with you

test(tui): say why the skills.changed refetch test's rpc casts are safe

Tekniumd01687a1df5c
diff --git a/ui-tui/src/__tests__/slashCatalogSkillsChanged.test.ts b/ui-tui/src/__tests__/slashCatalogSkillsChanged.test.ts
index 68b8bc5f244..f94c3d8188a 100644
--- a/ui-tui/src/__tests__/slashCatalogSkillsChanged.test.ts
+++ b/ui-tui/src/__tests__/slashCatalogSkillsChanged.test.ts
@@ -13,6 +13,7 @@ describe('refreshSlashCatalogOnSkillsChange', () => {
patchUiState({ sid: 'sid-cfg8' })
+ // SAFETY: the fake answers only commands.catalog, the one method the refetch calls, with that method's result type.
expect(refreshSlashCatalogOnSkillsChange({ type: 'skills.changed' }, rpc as never, setCatalog)).toBe(true)
await vi.waitFor(() => expect(setCatalog).toHaveBeenCalled())
@@ -23,6 +24,7 @@ describe('refreshSlashCatalogOnSkillsChange', () => {
it('leaves every other event to the main handler', () => {
const rpc = vi.fn()
+ // SAFETY: the fake is never called here; the event is not skills.changed, so no RPC goes out.
expect(refreshSlashCatalogOnSkillsChange({ type: 'skin.changed' }, rpc as never, vi.fn())).toBe(false)
expect(rpc).not.toHaveBeenCalled()
})