|
2 | 2 | * Copyright 2024 Digital Bazaar, Inc.
|
3 | 3 | * SPDX-License-Identifier: BSD-3-Clause
|
4 | 4 | */
|
| 5 | +import {assertions} from 'data-integrity-test-suite-assertion'; |
5 | 6 |
|
6 | 7 | export function assertConformance({
|
7 |
| - issuers, |
8 | 8 | verifiers,
|
9 | 9 | suiteName,
|
10 | 10 | keyType,
|
11 | 11 | vcVersion,
|
12 |
| - credentials |
| 12 | + credential, |
| 13 | + setup = _setup |
13 | 14 | }) {
|
14 | 15 | describe(`${suiteName} - Conformance - VC ${vcVersion}`, function() {
|
15 | 16 | this.matrix = true;
|
16 | 17 | this.report = true;
|
17 |
| - this.implemented = [...issuers]; |
| 18 | + this.implemented = [...verifiers]; |
18 | 19 | this.rowLabel = 'Test Name';
|
19 | 20 | this.columnLabel = 'Implementation';
|
20 |
| - for(const [name, {endpoints}] of issuers) { |
21 |
| - describe(`${name} ${keyType}`, function() { |
| 21 | + let credentials = new Map(); |
| 22 | + before(async function() { |
| 23 | + credentials = await setup({credential, suiteName, keyType}); |
| 24 | + }); |
| 25 | + for(const [name, {endpoints}] of verifiers) { |
| 26 | + const [verifier] = endpoints; |
| 27 | + describe(`${name}: ${keyType}`, function() { |
22 | 28 | beforeEach(function() {
|
23 | 29 | this.currentTest.cell = {
|
24 | 30 | rowId: this.currentTest.title,
|
25 |
| - columnId: `${name} ${keyType}` |
| 31 | + columnId: this.currentTest.parent.title |
26 | 32 | };
|
27 | 33 | });
|
28 |
| - it('Specifically, all relevant normative statements in Sections 2. Data ' + |
29 |
| - 'Model and 3. Algorithms of this document MUST be enforced.', function() { |
| 34 | + it('Specifically, all relevant normative statements in Sections 2. ' + |
| 35 | + 'Data Model and 3. Algorithms of this document MUST be enforced.', |
| 36 | + async function() { |
30 | 37 | this.test.link = 'https://w3c.github.io/vc-di-ecdsa/#:~:text=Specifically%2C%20all%20relevant%20normative%20statements%20in%20Sections%202.%20Data%20Model%20and%203.%20Algorithms%20of%20this%20document%20MUST%20be%20enforced.';
|
31 | 38 | });
|
32 | 39 | it('Conforming processors MUST produce errors when non-conforming ' +
|
33 |
| - 'documents are consumed.', function() { |
| 40 | + 'documents are consumed.', async function() { |
34 | 41 | this.test.link = 'https://w3c.github.io/vc-di-ecdsa/#:~:text=Conforming%20processors%20MUST%20produce%20errors%20when%20non%2Dconforming%20documents%20are%20consumed.';
|
| 42 | + await assertions.verificationFail({ |
| 43 | + verifier, |
| 44 | + credential: {}, |
| 45 | + reason: 'Should ' |
| 46 | + }); |
35 | 47 | });
|
36 | 48 | });
|
37 | 49 | }
|
38 | 50 | });
|
39 | 51 | }
|
| 52 | +async function _setup({}) { |
| 53 | + // not bs58 encoded verificationMethod |
| 54 | + // type is not DataIntegrityProof |
| 55 | + // invalid cryptosuite name |
40 | 56 |
|
| 57 | +} |
0 commit comments