@@ -2,16 +2,22 @@ let createCmd = require('./create.cmd');
2
2
let replaceCmd = require ( './replace.cmd' ) ;
3
3
let deleteCmd = require ( './delete.cmd' ) ;
4
4
let versionCmd = require ( './version.cmd' ) ;
5
+ let approveCmd = require ( '../workflow/approve.cmd' ) ;
6
+ let denyCmd = require ( '../workflow/approve.cmd' ) ;
5
7
6
8
createCmd . requiresAuthentication = false ;
7
9
replaceCmd . requiresAuthentication = false ;
8
10
deleteCmd . requiresAuthentication = false ;
9
11
versionCmd . requiresAuthentication = false ;
12
+ approveCmd . requiresAuthentication = false ;
13
+ denyCmd . requiresAuthentication = false ;
10
14
11
15
createCmd = createCmd . toCommand ( ) ;
12
16
replaceCmd = replaceCmd . toCommand ( ) ;
13
17
deleteCmd = deleteCmd . toCommand ( ) ;
14
18
versionCmd = versionCmd . toCommand ( ) ;
19
+ approveCmd = approveCmd . toCommand ( ) ;
20
+ denyCmd = denyCmd . toCommand ( ) ;
15
21
16
22
17
23
jest . mock ( '../../helpers/validation' , ( ) => { // eslint-disable-line
@@ -152,4 +158,24 @@ describe('root commands', () => {
152
158
} ) ;
153
159
} ) ;
154
160
} ) ;
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
+ } ) ;
155
181
} ) ;
0 commit comments