@@ -2,16 +2,22 @@ let createCmd = require('./create.cmd');
22let replaceCmd = require ( './replace.cmd' ) ;
33let deleteCmd = require ( './delete.cmd' ) ;
44let versionCmd = require ( './version.cmd' ) ;
5+ let approveCmd = require ( '../workflow/approve.cmd' ) ;
6+ let denyCmd = require ( '../workflow/approve.cmd' ) ;
57
68createCmd . requiresAuthentication = false ;
79replaceCmd . requiresAuthentication = false ;
810deleteCmd . requiresAuthentication = false ;
911versionCmd . requiresAuthentication = false ;
12+ approveCmd . requiresAuthentication = false ;
13+ denyCmd . requiresAuthentication = false ;
1014
1115createCmd = createCmd . toCommand ( ) ;
1216replaceCmd = replaceCmd . toCommand ( ) ;
1317deleteCmd = deleteCmd . toCommand ( ) ;
1418versionCmd = versionCmd . toCommand ( ) ;
19+ approveCmd = approveCmd . toCommand ( ) ;
20+ denyCmd = denyCmd . toCommand ( ) ;
1521
1622
1723jest . mock ( '../../helpers/validation' , ( ) => { // eslint-disable-line
@@ -152,4 +158,24 @@ describe('root commands', () => {
152158 } ) ;
153159 } ) ;
154160 } ) ;
161+
162+ describe ( 'Approve pending-approval workflow' , ( ) => {
163+ it ( 'should handle approve from spec' , async ( ) => {
164+ const argv = {
165+ buildId : 'buildId'
166+ } ;
167+ await approveCmd . handler ( argv ) ;
168+ await verifyResponsesReturned ( [ DEFAULT_RESPONSE , DEFAULT_RESPONSE ] ) ; // eslint-disable-line
169+ } ) ;
170+ } ) ;
171+
172+ describe ( 'Deny pending-approval workflow' , ( ) => {
173+ it ( 'should handle deny from spec' , async ( ) => {
174+ const argv = {
175+ buildId : 'buildId'
176+ } ;
177+ await denyCmd . handler ( argv ) ;
178+ await verifyResponsesReturned ( [ DEFAULT_RESPONSE , DEFAULT_RESPONSE ] ) ; // eslint-disable-line
179+ } ) ;
180+ } ) ;
155181} ) ;
0 commit comments