Skip to content

Commit

Permalink
fixed unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Ellenn-A committed Feb 7, 2024
1 parent e7a9275 commit 01514b7
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 9 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@digicatapult/veritable-cloudagent",
"version": "0.4.16",
"version": "0.4.17",
"main": "build/index",
"types": "build/index",
"files": [
Expand Down
5 changes: 2 additions & 3 deletions src/anoncreds/__tests__/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ describe('VeritableAnonCredsRegistry', function () {
})

// =====REVOCATION=========
describe.only('registerRevocationRegistryDefinition', function () {
describe('registerRevocationRegistryDefinition', function () {
const revocRegisterOptions: RegisterRevocationRegistryDefinitionOptions = {
revocationRegistryDefinition: {
issuerId: 'did:key:1234',
Expand All @@ -323,13 +323,12 @@ describe('VeritableAnonCredsRegistry', function () {
options: {},
}

it.only('should upload the revocation registry definition to IPFS and return the positive response containing a cid', async function () {
it('should upload the revocation registry definition to IPFS and return the positive response containing a cid', async function () {
const agentContext = withMockedAgentContext()
const ipfs = withHappyIpfs()
const registry = new VeritableAnonCredsRegistry(ipfs)

const result = await registry.registerRevocationRegistryDefinition(agentContext, revocRegisterOptions)
console.log(result)
expect(result).to.deep.equal({
revocationRegistryDefinitionMetadata: {},
revocationRegistryDefinitionState: {
Expand Down
2 changes: 1 addition & 1 deletion src/controllers/examples.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ export const outOfBandInvitationExample = {
'@id': 'd6472943-e5d0-4d95-8b48-790ed5a41931',
label: 'Aries Test Agent',
accept: ['didcomm/aip1', 'didcomm/aip2;env=rfc19'],
handshake_protocols: ['https://didcomm.org/didexchange/1.0', 'https://didcomm.org/connections/1.0'],
handshake_protocols: ['https://didcomm.org/didexchange/1.1', 'https://didcomm.org/connections/1.0'],
services: [
{
id: '#inline-0',
Expand Down
1 change: 1 addition & 0 deletions tests/unit/credential.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,7 @@ describe('CredentialController', () => {
createLegacyConnectionlessInvitationStub.resolves({
message: msg,
invitationUrl: 'https://example.com/invitation',
outOfBandRecord,
})

const response = await request(app).post('/oob/create-legacy-connectionless-invitation').send(inputParams)
Expand Down
2 changes: 2 additions & 0 deletions tests/unit/credentialDefinition.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ describe('CredentialDefinitionController', () => {
issuerId: testCredDef.issuerId,
schemaId: testCredDef.schemaId,
tag: testCredDef.tag,
supportRevocation: false,
})

const result = await getResult()
Expand Down Expand Up @@ -211,6 +212,7 @@ describe('CredentialDefinitionController', () => {
issuerId: testCredDef.issuerId,
schemaId: testCredDef.schemaId,
tag: testCredDef.tag,
supportRevocation: false,
})

expect(responseCredentialDeff.statusCode).to.be.equal(200)
Expand Down
2 changes: 2 additions & 0 deletions tests/unit/outofband.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ describe('OutOfBandController', () => {
createLegacyConnectionlessInvitationStub.resolves({
message: msg,
invitationUrl: 'https://example.com/invitation',
outOfBandRecord,
})

const getResult = () => createLegacyConnectionlessInvitationStub.firstCall.returnValue
Expand All @@ -218,6 +219,7 @@ describe('OutOfBandController', () => {
createLegacyConnectionlessInvitationStub.resolves({
message: msg,
invitationUrl: 'https://example.com/invitation',
outOfBandRecord,
})

const response = await request(app).post('/oob/create-legacy-connectionless-invitation').send(inputParams)
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/utils/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export function getTestOutOfBandInvitation() {
label: 'Aries Test Agent',

accept: ['didcomm/aip1', 'didcomm/aip2;env=rfc19'],
handshake_protocols: ['https://didcomm.org/didexchange/1.0', 'https://didcomm.org/connections/1.0'],
handshake_protocols: ['https://didcomm.org/didexchange/1.1', 'https://didcomm.org/connections/1.0'],
services: [
{
id: '#inline-0',
Expand Down Expand Up @@ -133,7 +133,7 @@ export function getTestOutOfBandRecord() {
'@id': 'd6472943-e5d0-4d95-8b48-790ed5a41931',
label: 'Aries Test Agent',
accept: ['didcomm/aip1', 'didcomm/aip2;env=rfc19'],
handshake_protocols: ['https://didcomm.org/didexchange/1.0', 'https://didcomm.org/connections/1.0'],
handshake_protocols: ['https://didcomm.org/didexchange/1.1', 'https://didcomm.org/connections/1.0'],
services: [
{
id: '#inline-0',
Expand Down

0 comments on commit 01514b7

Please sign in to comment.