Skip to content

Commit

Permalink
Add test for proof props in transformation options in create test.
Browse files Browse the repository at this point in the history
  • Loading branch information
aljones15 committed May 14, 2024
1 parent 9eeb503 commit f530b73
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions tests/suites/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/
import {createInitialVc, getBs58Bytes, supportsVc} from '../helpers.js';
import {

Check failure on line 7 in tests/suites/create.js

View workflow job for this annotation

GitHub Actions / lint (20.x)

Imports should be sorted alphabetically
checkEncoding,
shouldBeMultibaseEncoded,
shouldBeProofValue,
shouldVerifyDerivedProof
Expand Down Expand Up @@ -193,6 +194,38 @@ export function createSuite({
'the cryptographic suite (type), a cryptosuite identifier ' +
'(cryptosuite), and a verification method (verificationMethod).',
async function() {
bbsProofs.length.should.be.gte(
1,
'Expected at least one "bbs-2023" proof'
);
for(const proof of bbsProofs) {
should.exist(proof.type, 'Expected "proof.type" to exist.');
proof.type.should.equal(
'DataIntegrityProof',
'Expected "proof.type" to equal "DataIntegrityProof.'
);
should.exist(
proof.cryptosuite,
'Expected "proof.cryptosuite" to exist.'
);
proof.cryptosuite.should.equal(
'bbs-2023',
'Expected "proof.cryptosuite" to equal "bbs-2023"'
);
should.exist(
proof.verificationMethod,
'Expected "proof.verificationMethod" to exist.'
);
proof.verificationMethod.should.be.a(
'string',
'Expected "proof.verificationMethod" to be a string.'
);
const [publicKey] = proof.verificationMethod.split('#');
checkEncoding({
value: publicKey.substr(8),
propertyName: 'proof.verificationMethod'
});
}
});
});
}
Expand Down

0 comments on commit f530b73

Please sign in to comment.