@@ -174,21 +174,22 @@ describe('VisibleElements Component - Business Rules', () => {
174174 describe ( 'RULE: canSign depends on status and signer UUID' , ( ) => {
175175 it ( 'returns false when status is not ABLE_TO_SIGN' , ( ) => {
176176 filesStore . files [ 1 ] . status = FILE_STATUS . DRAFT
177- filesStore . files [ 1 ] . settings = { signerFileUuid : 'valid-uuid' }
177+ filesStore . files [ 1 ] . signers = [ { me : true , sign_request_uuid : 'valid-uuid' } ]
178178
179179 expect ( wrapper . vm . canSign ) . toBe ( false )
180180 } )
181181
182- it ( 'returns false when status is ABLE_TO_SIGN but no signerFileUuid ' , ( ) => {
182+ it ( 'returns false when status is ABLE_TO_SIGN but there is no current signer uuid ' , ( ) => {
183183 filesStore . files [ 1 ] . status = FILE_STATUS . ABLE_TO_SIGN
184- filesStore . files [ 1 ] . settings = { }
184+ filesStore . files [ 1 ] . signers = [ ]
185+ filesStore . files [ 1 ] . settings = { isApprover : false }
185186
186187 expect ( wrapper . vm . canSign ) . toBe ( false )
187188 } )
188189
189- it ( 'returns true when status is ABLE_TO_SIGN and has signerFileUuid ' , ( ) => {
190+ it ( 'returns true when status is ABLE_TO_SIGN and the current signer has sign_request_uuid ' , ( ) => {
190191 filesStore . files [ 1 ] . status = FILE_STATUS . ABLE_TO_SIGN
191- filesStore . files [ 1 ] . settings = { signerFileUuid : 'valid-uuid' }
192+ filesStore . files [ 1 ] . signers = [ { me : true , sign_request_uuid : 'valid-uuid' } ]
192193
193194 expect ( wrapper . vm . canSign ) . toBe ( true )
194195 } )
0 commit comments