Skip to content

Commit

Permalink
Add test to ensure issuanceDate is added to VC 1.1 VCs.
Browse files Browse the repository at this point in the history
  • Loading branch information
aljones15 committed Dec 6, 2023
1 parent 48e3ab0 commit 2aaf1e1
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions test/10-verify.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,27 @@ describe('vc.issue()', () => {
error.message.should
.contain('"suite.verificationMethod" property is required.');
});
it('should add issuanceDate to verifiable credentials', async () => {
const credential = jsonld.clone(mockCredential);
delete credential.issuanceDate;
const now = new Date();
const jsonDate = now.toJSON();
const expectedIssuanceDate = `${jsonDate.slice(0, jsonDate.length - 5)}Z`;
const verifiableCredential = await vc.issue({
credential,
suite,
documentLoader,
now
});
verifiableCredential.should.exist;
verifiableCredential.should.be.an('object');
verifiableCredential.should.have.property('proof');
verifiableCredential.proof.should.be.an('object');
verifiableCredential.should.have.property(
'issuanceDate',
expectedIssuanceDate
);
});
});

describe('vc.createPresentation()', () => {
Expand Down

0 comments on commit 2aaf1e1

Please sign in to comment.