Skip to content

Commit

Permalink
chore: minor cosmetics of test naming
Browse files Browse the repository at this point in the history
Signed-off-by: Moriarty <moritz@animo.id>
  • Loading branch information
Moriarty committed Feb 22, 2023
1 parent ec30c75 commit 634a86f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 22 deletions.
19 changes: 6 additions & 13 deletions packages/core/src/agent/MessageSender.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,16 @@
import type { SubjectMessage } from '../../../../tests/transport/SubjectInboundTransport'
import type { AgentMessage } from './AgentMessage'
import type { EnvelopeKeys } from './EnvelopeService'
import type { AgentMessageSentEvent } from './Events'
import type { TransportSession } from './TransportService'
import type { AgentContext } from './context'
import type { ConnectionRecord } from '../modules/connections'
import type { ResolvedDidCommService } from '../modules/didcomm'
import type { DidDocument } from '../modules/dids'
import type { OutOfBandRecord } from '../modules/oob/repository'
import type { OutboundTransport } from '../transport/OutboundTransport'
import type { OutboundPackage, EncryptedMessage } from '../types'
import type { AgentMessage } from './AgentMessage'
import type { EnvelopeKeys } from './EnvelopeService'
import type { AgentMessageSentEvent } from './Events'
import type { TransportSession } from './TransportService'
import type { AgentContext } from './context'

import { Subject } from 'rxjs'

import { SubjectTransportSession } from '../../../../tests/transport/SubjectInboundTransport'
import { DID_COMM_TRANSPORT_QUEUE, InjectionSymbols } from '../constants'
import { AckDecorator, AckValues } from '../decorators/ack/AckDecorator'
import { ReturnRouteTypes } from '../decorators/transport/TransportDecorator'
import { AriesFrameworkError, MessageSendingError } from '../error'
import { Logger } from '../logger'
Expand Down Expand Up @@ -420,7 +415,6 @@ export class MessageSender {

throw error
}
// message.setReturnRouting(ReturnRouteTypes.all, message.threadId)

const outboundPackage = await this.packMessage(agentContext, { message, keys, endpoint: service.serviceEndpoint })
outboundPackage.endpoint = service.serviceEndpoint
Expand Down Expand Up @@ -454,7 +448,6 @@ export class MessageSender {
this.emitMessageSentEvent(outboundMessageContext, OutboundMessageSendStatus.SentToSession)
return
} catch (error) {
// errors.push(error)
this.logger.debug(`Sending an outbound message via session failed with error: ${error.message}.`, error)
throw new MessageSendingError(
`Unable to send message to service: ${service.serviceEndpoint} ${JSON.stringify(
Expand All @@ -475,7 +468,7 @@ export class MessageSender {
throw new MessageSendingError(
`Unable to send message to service: ${
outboundMessageContext.serviceParams?.service.serviceEndpoint
} ${JSON.stringify(message.threadId)} ${JSON.stringify(session)}`,
} with threadId ${JSON.stringify(message.threadId)} `,
{
outboundMessageContext,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ describe('Present Proof', () => {
await faberProofExchangeRecordPromise
})

test('Faber starts with connection-less proof requests to Alice with auto-accept enabled and using other transport', async () => {
test('Faber starts with connection-less proof requests to Alice with auto-accept enabled and without outbound transport', async () => {
testLogger.test('Faber sends presentation request to Alice')

const { aliceAgent, faberAgent, aliceReplay, credDefId, faberReplay } = await setupProofsTest(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ describe('Present Proof', () => {
await faberProofExchangeRecordPromise
})

test('Faber starts with connection-less proof requests to Alice with auto-accept enabled and using other transport', async () => {
test('Faber starts with connection-less proof requests to Alice with auto-accept enabled and without outbound transport', async () => {
testLogger.test('Faber sends presentation request to Alice')

const { aliceAgent, faberAgent, aliceReplay, credDefId, faberReplay } = await setupProofsTest(
Expand Down
8 changes: 1 addition & 7 deletions packages/core/tests/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ import { OutOfBandRole } from '../src/modules/oob/domain/OutOfBandRole'
import { OutOfBandState } from '../src/modules/oob/domain/OutOfBandState'
import { OutOfBandInvitation } from '../src/modules/oob/messages'
import { OutOfBandRecord } from '../src/modules/oob/repository'
import { PredicateType, ProofPredicateInfo, AttributeFilter } from '../src/modules/proofs/formats/indy/models'
import { PredicateType } from '../src/modules/proofs/formats/indy/models'
import { ProofState } from '../src/modules/proofs/models/ProofState'
import { V1PresentationPreview } from '../src/modules/proofs/protocol/v1/models/V1PresentationPreview'
import { customDocumentLoader } from '../src/modules/vc/__tests__/documentLoader'
Expand Down Expand Up @@ -231,12 +231,6 @@ export function waitForProofExchangeRecordSubject(
filter((e) => threadId === undefined || e.payload.proofRecord.threadId === threadId),
filter((e) => parentThreadId === undefined || e.payload.proofRecord.parentThreadId === parentThreadId),
filter((e) => state === undefined || e.payload.proofRecord.state === state),
// filter(
// (e) =>
// state === undefined ||
// e.payload.proofRecord.state === state ||
// (state === 'done' && previousState === undefined && threadId === undefined && parentThreadId === undefined)
// ),
timeout(timeoutMs),
catchError(() => {
throw new Error(
Expand Down

0 comments on commit 634a86f

Please sign in to comment.