Skip to content

Commit 5cbb915

Browse files
committed
test: cover signer flow sign url selection
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
1 parent f137bab commit 5cbb915

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

src/tests/store/sign.spec.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,13 +278,26 @@ describe('useSignStore', () => {
278278
it('appends idDocApproval param when user is approver', () => {
279279
const store = useSignStore()
280280
store.document = createDocument({
281+
uuid: 'approver-file-uuid',
281282
settings: { isApprover: true },
282283
})
283-
const url = store.buildSignUrl('some-uuid', { documentId: 1 })
284+
const url = store.buildSignUrl('approver-file-uuid', { documentId: 1 })
284285

285286
expect(url).toContain('&idDocApproval=true')
286287
})
287288

289+
it('does not append idDocApproval param for approver signing as regular signer', () => {
290+
const store = useSignStore()
291+
store.document = createDocument({
292+
uuid: 'file-uuid',
293+
settings: { isApprover: true },
294+
})
295+
const url = store.buildSignUrl('sign-request-uuid', { documentId: 1 })
296+
297+
expect(url).toContain('/sign/uuid/sign-request-uuid')
298+
expect(url).not.toContain('idDocApproval')
299+
})
300+
288301
it('does not append idDocApproval param when user is not approver', () => {
289302
const store = useSignStore()
290303
store.document = createDocument({

0 commit comments

Comments
 (0)