Skip to content

Commit

Permalink
test: e2e fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
genaris committed Dec 6, 2024
1 parent 433b14f commit 26e19b5
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 12 deletions.
2 changes: 1 addition & 1 deletion packages/core/tests/proofs-sub-protocol.e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { EventReplaySubject } from './events'
import type { AnonCredsTestsAgent } from '../../anoncreds/tests/legacyAnonCredsSetup'

import { issueLegacyAnonCredsCredential, setupAnonCredsTests } from '../../anoncreds/tests/legacyAnonCredsSetup'
import { ProofState } from '../src/modules/proofs/models/ProofState'
import { ProofState } from '../src/modules/didcomm/modules/proofs'
import { uuid } from '../src/utils/uuid'

import { waitForProofExchangeRecord } from './helpers'
Expand Down
13 changes: 8 additions & 5 deletions tests/e2e-http.e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { HttpInboundTransport } from '@credo-ts/node'
const recipientAgentOptions = getInMemoryAgentOptions(
'E2E HTTP Recipient',
{},
{},
{
...getAnonCredsModules({
autoAcceptCredentials: AutoAcceptCredential.ContentApproved,
Expand All @@ -35,6 +36,7 @@ const mediatorAgentOptions = getInMemoryAgentOptions(
{
endpoints: [`http://localhost:${mediatorPort}`],
},
{},
{
...getAnonCredsModules({
autoAcceptCredentials: AutoAcceptCredential.ContentApproved,
Expand All @@ -51,6 +53,7 @@ const senderAgentOptions = getInMemoryAgentOptions(
{
endpoints: [`http://localhost:${senderPort}`],
},
{},
getAnonCredsModules({
autoAcceptCredentials: AutoAcceptCredential.ContentApproved,
})
Expand Down Expand Up @@ -78,17 +81,17 @@ describe('E2E HTTP tests', () => {

test('Full HTTP flow (connect, request mediation, issue, verify)', async () => {
// Recipient Setup
recipientAgent.registerOutboundTransport(new HttpOutboundTransport())
recipientAgent.didcomm.registerOutboundTransport(new HttpOutboundTransport())
await recipientAgent.initialize()

// Mediator Setup
mediatorAgent.registerInboundTransport(new HttpInboundTransport({ port: mediatorPort }))
mediatorAgent.registerOutboundTransport(new HttpOutboundTransport())
mediatorAgent.didcomm.registerInboundTransport(new HttpInboundTransport({ port: mediatorPort }))
mediatorAgent.didcomm.registerOutboundTransport(new HttpOutboundTransport())
await mediatorAgent.initialize()

// Sender Setup
senderAgent.registerInboundTransport(new HttpInboundTransport({ port: senderPort }))
senderAgent.registerOutboundTransport(new HttpOutboundTransport())
senderAgent.didcomm.registerInboundTransport(new HttpInboundTransport({ port: senderPort }))
senderAgent.didcomm.registerOutboundTransport(new HttpOutboundTransport())
await senderAgent.initialize()

await e2eTest({
Expand Down
13 changes: 8 additions & 5 deletions tests/e2e-subject.e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
const recipientAgentOptions = getInMemoryAgentOptions(
'E2E Subject Recipient',
{},
{},
{
...getAnonCredsModules({
autoAcceptCredentials: AutoAcceptCredential.ContentApproved,
Expand All @@ -35,6 +36,7 @@ const mediatorAgentOptions = getInMemoryAgentOptions(
{
endpoints: ['rxjs:mediator'],
},
{},
{
...getAnonCredsModules({
autoAcceptCredentials: AutoAcceptCredential.ContentApproved,
Expand All @@ -47,6 +49,7 @@ const senderAgentOptions = getInMemoryAgentOptions(
{
endpoints: ['rxjs:sender'],
},
{},
{
...getAnonCredsModules({
autoAcceptCredentials: AutoAcceptCredential.ContentApproved,
Expand Down Expand Up @@ -88,17 +91,17 @@ describe('E2E Subject tests', () => {
}

// Recipient Setup
recipientAgent.registerOutboundTransport(new SubjectOutboundTransport(subjectMap))
recipientAgent.didcomm.registerOutboundTransport(new SubjectOutboundTransport(subjectMap))
await recipientAgent.initialize()

// Mediator Setup
mediatorAgent.registerOutboundTransport(new SubjectOutboundTransport(subjectMap))
mediatorAgent.registerInboundTransport(new SubjectInboundTransport(mediatorMessages))
mediatorAgent.didcomm.registerOutboundTransport(new SubjectOutboundTransport(subjectMap))
mediatorAgent.didcomm.registerInboundTransport(new SubjectInboundTransport(mediatorMessages))
await mediatorAgent.initialize()

// Sender Setup
senderAgent.registerOutboundTransport(new SubjectOutboundTransport(subjectMap))
senderAgent.registerInboundTransport(new SubjectInboundTransport(senderMessages))
senderAgent.didcomm.registerOutboundTransport(new SubjectOutboundTransport(subjectMap))
senderAgent.didcomm.registerInboundTransport(new SubjectInboundTransport(senderMessages))
await senderAgent.initialize()

await e2eTest({
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e-ws-pickup-v2.e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { AnonCredsTestsAgent } from '../packages/anoncreds/tests/anoncredsS

import { getAnonCredsModules } from '../packages/anoncreds/tests/anoncredsSetup'
import { askarModule } from '../packages/askar/tests/helpers'
import { MessageForwardingStrategy } from '../packages/core/src/modules/routing/MessageForwardingStrategy'
import { MessageForwardingStrategy } from '../packages/core/src/modules/didcomm/modules/routing/MessageForwardingStrategy'
import { getAgentOptions } from '../packages/core/tests/helpers'

import { e2eTest } from './e2e-test'
Expand Down

0 comments on commit 26e19b5

Please sign in to comment.