Skip to content

Commit

Permalink
Add credentialStatus to VCs in status tests & fix assertion in negati…
Browse files Browse the repository at this point in the history
…ve test.
  • Loading branch information
aljones15 committed Dec 6, 2023
1 parent 48e3ab0 commit cc05678
Showing 1 changed file with 33 additions and 3 deletions.
36 changes: 33 additions & 3 deletions test/10-verify.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -304,8 +304,23 @@ describe('verify API (credentials)', () => {
});

it('should verify a vc with a positive status check', async () => {
const credential = jsonld.clone(mockCredential);
credential['@context'].push({
'@context': {
id: '@id',
type: '@type',
TestStatusList: {
'@id': 'https://example.edu/TestStatusList',
'@type': '@id'
}
}
});
credential.credentialStatus = {
id: 'https://example.edu/status/24',
type: 'TestStatusList'
};
const verifiableCredential = await vc.issue({
credential: mockCredential,
credential,
suite,
documentLoader
});
Expand Down Expand Up @@ -402,8 +417,23 @@ describe('verify API (credentials)', () => {
results.verified.should.be.false;
});
it('should fail to verify a vc with a negative status check', async () => {
const credential = jsonld.clone(mockCredential);
credential['@context'].push({
'@context': {
id: '@id',
type: '@type',
TestStatusList: {
'@id': 'https://example.edu/TestStatusList',
'@type': '@id'
}
}
});
credential.credentialStatus = {
id: 'https://example.edu/status/24',
type: 'TestStatusList'
};
const verifiableCredential = await vc.issue({
credential: mockCredential,
credential,
suite,
documentLoader
});
Expand All @@ -418,7 +448,7 @@ describe('verify API (credentials)', () => {
if(result.error) {
throw result.error;
}
result.verified.should.be.true;
result.verified.should.be.false;
});
it('should verify a changed derived vc', async () => {
const proofId = `urn:uuid:${uuid()}`;
Expand Down

0 comments on commit cc05678

Please sign in to comment.