Skip to content

Commit 546e541

Browse files
test: cover signer-scoped uuid utility behavior
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
1 parent 1153e41 commit 546e541

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

src/tests/utils/signRequestUuid.spec.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,19 @@ describe('signRequestUuid utils', () => {
3232
expect(getCurrentSignerSignRequestUuid(undefined, 'fallback-uuid')).toBe('fallback-uuid')
3333
})
3434

35-
it('returns the file uuid for approver signing routes', () => {
35+
it('prefers the current signer sign_request_uuid for approver-capable routes', () => {
3636
expect(getSigningRouteUuid({
3737
uuid: 'file-uuid',
3838
settings: { isApprover: true },
3939
signers: [{ me: true, sign_request_uuid: 'sign-request-uuid' }],
40+
})).toBe('sign-request-uuid')
41+
})
42+
43+
it('falls back to file uuid for approver signing routes when signer uuid is unavailable', () => {
44+
expect(getSigningRouteUuid({
45+
uuid: 'file-uuid',
46+
settings: { isApprover: true },
47+
signers: [],
4048
})).toBe('file-uuid')
4149
})
4250

@@ -57,4 +65,4 @@ describe('signRequestUuid utils', () => {
5765
it('falls back to numeric id for validation routes when uuid is unavailable', () => {
5866
expect(getValidationRouteUuid({ id: 42 })).toBe(42)
5967
})
60-
})
68+
})

0 commit comments

Comments
 (0)