@@ -6,14 +6,26 @@ import { describe, expect, it } from 'vitest'
66import { TOOL_CATALOG } from '@/lib/copilot/generated/tool-catalog-v1'
77import { isToolHiddenInUi } from '@/lib/copilot/tools/client/hidden-tools'
88import { getToolActivityLabel , TOOL_ACTIVITIES } from '@/lib/copilot/tools/tool-activity'
9+ import { TOOL_ICONS } from '@/app/workspace/[workspaceId]/home/components/message-content/utils'
910
1011const visibleTools = Object . values ( TOOL_CATALOG ) . filter (
1112 ( tool ) => tool . route !== 'subagent' && ! tool . hidden && ! isToolHiddenInUi ( tool . id )
1213)
1314
1415describe ( 'tool activity catalog coverage' , ( ) => {
16+ it ( 'covers subagent icons under their dispatch and stream names' , ( ) => {
17+ for ( const tool of Object . values ( TOOL_CATALOG ) ) {
18+ if ( tool . route !== 'subagent' ) continue
19+ expect ( Object . hasOwn ( TOOL_ICONS , tool . id ) , tool . id ) . toBe ( true )
20+ if ( tool . subagentId ) {
21+ expect ( Object . hasOwn ( TOOL_ICONS , tool . subagentId ) , tool . subagentId ) . toBe ( true )
22+ }
23+ }
24+ } )
25+
1526 it . each ( visibleTools ) ( 'explicitly describes $id and every declared operation' , ( tool ) => {
16- expect ( Object . hasOwn ( TOOL_ACTIVITIES , tool . id ) , tool . id ) . toBe ( true )
27+ expect ( Object . hasOwn ( TOOL_ACTIVITIES , tool . id ) , `${ tool . id } summary` ) . toBe ( true )
28+ expect ( Object . hasOwn ( TOOL_ICONS , tool . id ) , `${ tool . id } icon` ) . toBe ( true )
1729 const activity = TOOL_ACTIVITIES [ tool . id ]
1830 const properties = isRecordLike ( tool . parameters ) ? tool . parameters . properties : undefined
1931 if ( ! isRecordLike ( properties ) ) return
0 commit comments