From 2a0849ca1c743b5537656993a9df17872f5b8d42 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Mon, 16 Sep 2024 14:35:59 +0000 Subject: [PATCH] SD tests now include validFrom and/or validUntil. --- test/50-issue.spec.js | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/test/50-issue.spec.js b/test/50-issue.spec.js index 0bec97e9..a09674e4 100644 --- a/test/50-issue.spec.js +++ b/test/50-issue.spec.js @@ -145,13 +145,15 @@ function _runSuite({ credential.validUntil = createSkewedTimeStamp({skewYear: 1}); let error; let verifiableCredential; + const testPointers = derived ? + [...selectivePointers, '/validUntil'] : []; try { ({verifiableCredential} = await issueCredential({ credential, derived, suites, mandatoryPointers, - selectivePointers, + selectivePointers: testPointers, issuer: keyDoc.controller, documentLoader })); @@ -177,13 +179,15 @@ function _runSuite({ credential.validUntil = createSkewedTimeStamp({skewYear: -1}); let error; let verifiableCredential; + const testPointers = derived ? + [...selectivePointers, '/validUntil'] : []; try { ({verifiableCredential} = await issueCredential({ credential, derived, suites, mandatoryPointers, - selectivePointers, + selectivePointers: testPointers, issuer: keyDoc.controller, documentLoader })); @@ -208,13 +212,15 @@ function _runSuite({ credential.validFrom = createSkewedTimeStamp({skewYear: -1}); let error; let verifiableCredential; + const testPointers = derived ? + [...selectivePointers, '/validFrom'] : []; try { ({verifiableCredential} = await issueCredential({ credential, derived, suites, mandatoryPointers, - selectivePointers, + selectivePointers: testPointers, issuer: keyDoc.controller, documentLoader })); @@ -239,13 +245,15 @@ function _runSuite({ credential.validFrom = createSkewedTimeStamp({skewYear: 1}); let error; let verifiableCredential; + const testPointers = derived ? + [...selectivePointers, '/validFrom'] : []; try { ({verifiableCredential} = await issueCredential({ credential, derived, suites, mandatoryPointers, - selectivePointers, + selectivePointers: testPointers, issuer: keyDoc.controller, documentLoader })); @@ -271,13 +279,15 @@ function _runSuite({ credential.validUntil = createSkewedTimeStamp({skewYear: 1}); let error; let verifiableCredential; + const testPointers = derived ? + [...selectivePointers, '/validFrom', '/validUntil'] : []; try { ({verifiableCredential} = await issueCredential({ credential, derived, suites, mandatoryPointers, - selectivePointers, + selectivePointers: testPointers, issuer: keyDoc.controller, documentLoader }));