Skip to content

Commit

Permalink
SD tests now include validFrom and/or validUntil.
Browse files Browse the repository at this point in the history
  • Loading branch information
aljones15 committed Sep 16, 2024
1 parent c3b7716 commit 2a0849c
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions test/50-issue.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}));
Expand All @@ -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
}));
Expand All @@ -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
}));
Expand All @@ -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
}));
Expand All @@ -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
}));
Expand Down

0 comments on commit 2a0849c

Please sign in to comment.