Skip to content

Commit

Permalink
Add test statement for validFrom and validUntil.
Browse files Browse the repository at this point in the history
  • Loading branch information
aljones15 committed Jan 2, 2024
1 parent 488dd0c commit c7ba7ca
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/10-vcdm2.js
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,20 @@ describe('Verifiable Credentials Data Model v2.0', function() {
negativeTest.validUntil = createTimeStamp({skew: -2});
assert.rejects(issue(negativeTest));
});
it2('If a validFrom value also exists, the validUntil value MUST ' +
'express a datetime that is temporally the same or later than the ' +
'datetime expressed by the validFrom value.', async function() {
const positiveTest = require(
'./input/credential-validUntil-validFrom-ok.json');
positiveTest.validFrom = createTimeStamp({skew: -2});
positiveTest.validUntil = createTimeStamp({skew: 2});
await issue(positiveTest);
const negativeTest = require(
'./input/credential-validUntil-validFrom-fail.json');
negativeTest.validFrom = createTimeStamp({skew: 2});
negativeTest.validUntil = createTimeStamp({skew: -2});
assert.rejects(issue(negativeTest));
});
// FIXME remove as this doesn't seem to be in the spec
it.skip('At least one proof mechanism, and the details necessary ' +
'to evaluate that proof, MUST be expressed for a credential or ' +
Expand Down

0 comments on commit c7ba7ca

Please sign in to comment.