From 6845628f6e8104766335f5d4778a765084b73590 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9cio=20Varj=C3=A3o?= <1348549+cvarjao@users.noreply.github.com> Date: Thu, 31 Oct 2024 14:46:43 -0700 Subject: [PATCH] add deep link test case MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Clécio Varjão <1348549+cvarjao@users.noreply.github.com> --- src/Agent.ts | 2 +- src/AgentManual.ts | 4 ++-- src/deep-links.test.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Agent.ts b/src/Agent.ts index 61b9534..a5b1c43 100644 --- a/src/Agent.ts +++ b/src/Agent.ts @@ -42,7 +42,7 @@ export interface AriesAgent { readonly logger: Logger sendBasicMessage(connection_id: string, content: string): Promise createInvitationToConnect(invitationType: T, args?: InvitationArgumentMapping[T]): Promise> - receiveInvitation(invitation: ResponseCreateInvitation): Promise; + receiveInvitation(invitation: ResponseCreateInvitation, appName?:string): Promise; startup(): Promise; shutdown(): Promise; createSchema( builder: SchemaBuilder) : Promise diff --git a/src/AgentManual.ts b/src/AgentManual.ts index c9ea4a0..0a36b8a 100644 --- a/src/AgentManual.ts +++ b/src/AgentManual.ts @@ -46,7 +46,7 @@ export class AgentManual implements AriesAgent { async createInvitationToConnect(_invitationType: T): Promise> { throw new Error("Method not implemented."); } - async receiveInvitation(ref: ResponseCreateInvitation): Promise { + async receiveInvitation(ref: ResponseCreateInvitation, appName:string = 'BC Wallet App'): Promise { const relativePath = './tmp/__qrcode.png' const QRCodePath = path.resolve(process.cwd() as string, relativePath) fs.mkdirSync(path.dirname(QRCodePath), { recursive: true }) @@ -57,7 +57,7 @@ export class AgentManual implements AriesAgent { ref.payload.invitation_url, {margin: 10} ) - log(chalk.yellowBright(`> Scan QR Code image from ${relativePath}`)) + log(chalk.yellowBright(`> Scan QR Code image using "${appName}" from ${relativePath}`)) return {} } public async startup(){ diff --git a/src/deep-links.test.ts b/src/deep-links.test.ts index 1e55b3c..a7926e6 100644 --- a/src/deep-links.test.ts +++ b/src/deep-links.test.ts @@ -82,7 +82,7 @@ describe("deep-links", () => { logger.info(`Executing ${expect.getState().currentTestName}`) const remoteInvitation = await withDeepLinkPage(await withRedirectUrl(await issuer.createInvitationToConnect(INVITATION_TYPE.OOB_DIDX_1_1))) logger.info(`waiting for holder to accept connection`) - const agentBConnectionRef1 = await holder.receiveInvitation(remoteInvitation) + const agentBConnectionRef1 = await holder.receiveInvitation(remoteInvitation, "Generic Camera App") logger.info(`waiting for issuer to accept connection`) const {connection_id} = await issuer.waitForOOBConnectionReady(remoteInvitation.payload.invi_msg_id) logger.info(`${connection_id} connected to ${agentBConnectionRef1.connectionRecord?.connection_id}`)