diff --git a/tests/10-rdfc-create.js b/tests/10-rdfc-create.js index b67acf5..a12d0c2 100644 --- a/tests/10-rdfc-create.js +++ b/tests/10-rdfc-create.js @@ -55,7 +55,8 @@ describe('ecdsa-rdfc-2019 (create)', function() { before(async function() { issuedVc = await createInitialVc({ issuer, - vc: credentials.create[vcVersion].document + vc: credentials.create[vcVersion].document, + vcVersion }); // VCs can have multiple proofs so account for that proofs = Array.isArray(issuedVc?.proof) ? issuedVc.proof : diff --git a/tests/30-rdfc-interop.js b/tests/30-rdfc-interop.js index 62f93c4..d5af593 100644 --- a/tests/30-rdfc-interop.js +++ b/tests/30-rdfc-interop.js @@ -78,7 +78,8 @@ const { before(async function() { issuedVc = await createInitialVc({ issuer: issuerEndpoint, - vc: credentials.interop['1.1'].document + vc: credentials.interop['1.1'].document, + vcVersion: '1.1' }); }); it(`"${verifierDisplayName}" should verify "${issuerDisplayName}"`, diff --git a/tests/40-sd-create.js b/tests/40-sd-create.js index 0d3ec37..2318153 100644 --- a/tests/40-sd-create.js +++ b/tests/40-sd-create.js @@ -55,7 +55,8 @@ describe('ecdsa-sd-2023 (create)', function() { issuer, vc: credentials.create[vcVersion].document, mandatoryPointers: - credentials.create[vcVersion].mandatoryPointers + credentials.create[vcVersion].mandatoryPointers, + vcVersion }); // Support multiple proofs proofs = Array.isArray(issuedVc?.proof) ? issuedVc.proof : diff --git a/tests/60-sd-interop.js b/tests/60-sd-interop.js index f8e403c..a623eda 100644 --- a/tests/60-sd-interop.js +++ b/tests/60-sd-interop.js @@ -85,7 +85,8 @@ const { const issuedVc = await createInitialVc({ issuer: issuerEndpoint, vc: credentials.interop['2.0'].document, - mandatoryPointers: credentials.interop['2.0'].mandatoryPointers + mandatoryPointers: credentials.interop['2.0'].mandatoryPointers, + vcVersion: '2.0' }); const {match: matchingVcHolders} = endpoints.filterByTag({ tags: ['vcHolder'], diff --git a/tests/helpers.js b/tests/helpers.js index 451a71f..80afa36 100644 --- a/tests/helpers.js +++ b/tests/helpers.js @@ -30,15 +30,23 @@ export const ISOTimeStamp = ({date = new Date()} = {}) => { * @param {object} options.vc - The credential to be issued. * @param {Array} [options.mandatoryPointers] - An optional * array of mandatory pointers. + * @param {string} options.vcVersion - The version of the VC. * * @returns {Promise} The resulting issuance result. */ -export const createInitialVc = async ({issuer, vc, mandatoryPointers}) => { +export const createInitialVc = async ({ + issuer, + vc, + mandatoryPointers, + vcVersion +}) => { const {settings: {id: issuerId, options = {}}} = issuer; const credential = klona(vc); credential.id = `urn:uuid:${uuidv4()}`; credential.issuer = issuerId; - credential.issuanceDate = ISOTimeStamp(); + if(vcVersion === '1.1') { + credential.issuanceDate = ISOTimeStamp(); + } const body = {credential, options}; // if there are mandatoryPointers for sd tests add them if(Array.isArray(mandatoryPointers)) {