Skip to content

Commit e7d9a88

Browse files
committed
Use didResolver to assert on publicKeyMultibase.
1 parent 4edf3a5 commit e7d9a88

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

tests/suites/data-model.js

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {createInitialVc, endpointCheck} from '../helpers.js';
66
import {
77
assertions,
88
} from 'data-integrity-test-suite-assertion';
9+
import {didResolver} from '../didResolver.js';
910
import {expect} from 'chai';
1011

1112
export function dataModelSuite({
@@ -70,9 +71,12 @@ export function dataModelSuite({
7071
for(const proof of proofs) {
7172
expect(proof.verificationMethod).to.exist;
7273
expect(proof.verificationMethod).to.be.a('string');
74+
const didDoc = await didResolver({url: proof.verificationMethod});
75+
expect(didDoc).to.be.an('object');
76+
expect(didDoc.publicKeyMultibase).to.be.a('string');
7377
expect(
74-
assertions.shouldBeBs58(proof.verificationMethod),
75-
'Expected "proof.verificationMethod" to be Base58 encoded'
78+
assertions.shouldBeBs58(didDoc.publicKeyMultibase),
79+
'Expected "publicKeyMultibase" to be Base58 encoded'
7680
).to.be.true;
7781
}
7882
});
@@ -83,9 +87,12 @@ export function dataModelSuite({
8387
for(const proof of proofs) {
8488
expect(proof.verificationMethod).to.exist;
8589
expect(proof.verificationMethod).to.be.a('string');
90+
const didDoc = await didResolver({url: proof.verificationMethod});
91+
expect(didDoc).to.be.an('object');
92+
expect(didDoc.publicKeyMultibase).to.be.a('string');
8693
expect(
87-
assertions.shouldBeBs58(proof.verificationMethod),
88-
'Expected "proof.verificationMethod" to be Base58 encoded'
94+
assertions.shouldBeBs58(didDoc.publicKeyMultibase),
95+
'Expected "publicKeyMultibase" to be Base58 encoded'
8996
).to.be.true;
9097
}
9198
});

0 commit comments

Comments
 (0)