@@ -23,57 +23,11 @@ import AgentValidateAuthoringBundle, {
2323import { throwAgentCompilationError } from '../../../../src/common.js' ;
2424
2525describe ( 'Agent Validate Authoring Bundle' , ( ) => {
26- describe ( 'command configuration' , ( ) => {
27- it ( 'should have correct summary' , ( ) => {
28- expect ( AgentValidateAuthoringBundle . summary ) . to . equal ( 'Validate an Agent Authoring Bundle' ) ;
29- } ) ;
30-
31- it ( 'should require project' , ( ) => {
32- expect ( AgentValidateAuthoringBundle . requiresProject ) . to . be . true ;
33- } ) ;
34-
35- it ( 'should have correct flags' , ( ) => {
36- const flags = AgentValidateAuthoringBundle . flags ;
37- expect ( flags ) . to . have . property ( 'target-org' ) ;
38- expect ( flags ) . to . have . property ( 'api-version' ) ;
39- expect ( flags ) . to . have . property ( 'api-name' ) ;
40- } ) ;
41- } ) ;
42-
43- describe ( 'flag validation' , ( ) => {
44- it ( 'should validate API name format' , ( ) => {
45- const prompts = AgentValidateAuthoringBundle [ 'FLAGGABLE_PROMPTS' ] ;
46-
47- // Valid API names
48- expect ( prompts [ 'api-name' ] . validate ( 'ValidApiName' ) ) . to . equal ( true ) ;
49- expect ( prompts [ 'api-name' ] . validate ( 'Valid_Api_Name_123' ) ) . to . equal ( true ) ;
50- expect ( prompts [ 'api-name' ] . validate ( 'aa' ) ) . to . equal ( true ) ;
51- expect ( prompts [ 'api-name' ] . validate ( 'MyAgent_Test_1' ) ) . to . equal ( true ) ;
52-
53- // Invalid API names - empty
54- expect ( prompts [ 'api-name' ] . validate ( '' ) ) . to . equal ( 'Invalid API name.' ) ;
55-
56- // Invalid API names - starts with invalid character
57- expect ( prompts [ 'api-name' ] . validate ( 'Invalid-Name' ) ) . to . equal ( 'Invalid API name.' ) ;
58- expect ( prompts [ 'api-name' ] . validate ( '123StartsWithNumber' ) ) . to . equal ( 'Invalid API name.' ) ;
59- expect ( prompts [ 'api-name' ] . validate ( '_StartsWithUnderscore' ) ) . to . equal ( 'Invalid API name.' ) ;
60- expect ( prompts [ 'api-name' ] . validate ( '-StartsWithDash' ) ) . to . equal ( 'Invalid API name.' ) ;
61-
62- // Invalid API names - too long
63- expect ( prompts [ 'api-name' ] . validate ( 'a' . repeat ( 81 ) ) ) . to . equal ( 'API name cannot be over 80 characters.' ) ;
64-
65- // Invalid API names - invalid characters
66- expect ( prompts [ 'api-name' ] . validate ( 'Invalid.Name' ) ) . to . equal ( 'Invalid API name.' ) ;
67- expect ( prompts [ 'api-name' ] . validate ( 'Invalid Name' ) ) . to . equal ( 'Invalid API name.' ) ;
68- expect ( prompts [ 'api-name' ] . validate ( 'Invalid@Name' ) ) . to . equal ( 'Invalid API name.' ) ;
69- } ) ;
70- } ) ;
71-
7226 describe ( 'prompt configuration' , ( ) => {
7327 it ( 'should have correct prompt messages' , ( ) => {
7428 const prompts = AgentValidateAuthoringBundle [ 'FLAGGABLE_PROMPTS' ] ;
7529
76- expect ( prompts [ 'api-name' ] . message ) . to . equal ( 'API name of the Agent Authoring Bundle to validate.' ) ;
30+ expect ( prompts [ 'api-name' ] . message ) . to . equal ( 'API name of the authoring bundle you want to validate.' ) ;
7731 expect ( prompts [ 'api-name' ] . promptMessage ) . to . equal ( 'API name of the authoring bundle to validate' ) ;
7832 } ) ;
7933 } ) ;
0 commit comments