@@ -71,6 +71,27 @@ describe('humanizeToolName', () => {
7171} )
7272
7373describe ( 'getToolDisplayTitle natural-language coverage' , ( ) => {
74+ it . each ( [ 'cli_workflows_operations_apply' , 'cli_workflows_state_replace' ] ) (
75+ 'distinguishes validation from mutation for %s' ,
76+ ( name ) => {
77+ const command =
78+ name === 'cli_workflows_operations_apply' ? [ 'operations' , 'apply' ] : [ 'state' , 'replace' ]
79+ const args = [ '--output' , 'json' , 'workflows' , ...command , 'workflow-id' ]
80+ const title = getToolDisplayTitle ( name , { args : [ ...args , '--dry-run' ] } )
81+ expect ( title ) . toBe ( 'Validating workflow changes' )
82+ expect ( getToolStatusDisplayTitle ( title , 'success' , name ) ) . toBe ( 'Validated workflow changes' )
83+ expect ( getToolStatusDisplayTitle ( title , 'error' , name ) ) . toBe (
84+ 'Failed validating workflow changes'
85+ )
86+ expect ( getToolDisplayTitle ( name , { args } ) ) . toBe (
87+ name === 'cli_workflows_operations_apply' ? 'Editing workflow' : 'Rewriting workflow'
88+ )
89+ expect (
90+ getToolDisplayTitle ( name , { args : [ ...args , '--operations' , '["--dry-run"]' ] } )
91+ ) . not . toBe ( 'Validating workflow changes' )
92+ }
93+ )
94+
7495 it ( 'gives gerund titles to tools that previously fell through to humanize' , ( ) => {
7596 expect ( getToolDisplayTitle ( 'deploy_as_api' ) ) . toBe ( 'Deploying as API' )
7697 expect ( getToolDisplayTitle ( 'list_workspace_mcp_servers' ) ) . toBe ( 'Listing MCP servers' )
0 commit comments