Skip to content

Commit 0c32e03

Browse files
committed
Add initial data-model test.
1 parent 36cb201 commit 0c32e03

File tree

2 files changed

+39
-1
lines changed

2 files changed

+39
-1
lines changed

tests/80-data-model.js

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/*!
2+
* Copyright 2024 Digital Bazaar, Inc.
3+
* SPDX-License-Identifier: BSD-3-Clause
4+
*/
5+
import {dataModelSuite} from './suites/data-model.js';
6+
import {endpoints} from 'vc-test-suite-implementations';
7+
import {getSuiteConfig} from './test-config.js';
8+
9+
const cryptosuites = [
10+
'ecdsa-rdfc-2019',
11+
'ecdsa-jcs-2019'
12+
];
13+
14+
for(const suiteName of cryptosuites) {
15+
const {tags, credentials, vectors} = getSuiteConfig(suiteName);
16+
const {match: issuers} = endpoints.filterByTag({
17+
tags: [...tags],
18+
property: 'issuers'
19+
});
20+
for(const vcVersion of vectors.vcTypes) {
21+
const {
22+
document,
23+
mandatoryPointers,
24+
selectivePointers
25+
} = credentials.create[vcVersion];
26+
for(const keyType of vectors.keyTypes) {
27+
dataModelSuite({
28+
issuers,
29+
suiteName,
30+
keyType,
31+
vcVersion,
32+
credential: document,
33+
mandatoryPointers,
34+
selectivePointers
35+
});
36+
}
37+
}
38+
}

tests/suites/data-model.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ export function dataModelSuite({
107107
for(const proof of proofs) {
108108
expect(proof.cryptosuite).to.exist;
109109
expect(proof.cryptosuite).to.be.a('string');
110-
expect(proof.cryptosuite).to.oneOf(
110+
expect(proof.cryptosuite).to.be.oneOf(
111111
['eddsa-rdfc-2022', 'eddsa-jcs-2022']);
112112
}
113113
});

0 commit comments

Comments
 (0)