Skip to content

Commit

Permalink
add deep link test case
Browse files Browse the repository at this point in the history
Signed-off-by: Clécio Varjão <[email protected]>
  • Loading branch information
cvarjao committed Oct 31, 2024
1 parent c2b8efc commit 6845628
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export interface AriesAgent {
readonly logger: Logger
sendBasicMessage(connection_id: string, content: string): Promise<any>
createInvitationToConnect<T extends INVITATION_TYPE>(invitationType: T, args?: InvitationArgumentMapping[T]): Promise<CreateInvitationResponse<T>>
receiveInvitation(invitation: ResponseCreateInvitation): Promise<ReceiveInvitationResponse>;
receiveInvitation(invitation: ResponseCreateInvitation, appName?:string): Promise<ReceiveInvitationResponse>;
startup(): Promise<void>;
shutdown(): Promise<void>;
createSchema( builder: SchemaBuilder) : Promise<string | undefined>
Expand Down
4 changes: 2 additions & 2 deletions src/AgentManual.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export class AgentManual implements AriesAgent {
async createInvitationToConnect<T extends INVITATION_TYPE>(_invitationType: T): Promise<CreateInvitationResponse<T>> {
throw new Error("Method not implemented.");
}
async receiveInvitation(ref: ResponseCreateInvitation): Promise<ReceiveInvitationResponse> {
async receiveInvitation(ref: ResponseCreateInvitation, appName:string = 'BC Wallet App'): Promise<ReceiveInvitationResponse> {
const relativePath = './tmp/__qrcode.png'
const QRCodePath = path.resolve(process.cwd() as string, relativePath)
fs.mkdirSync(path.dirname(QRCodePath), { recursive: true })
Expand All @@ -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(){
Expand Down
2 changes: 1 addition & 1 deletion src/deep-links.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`)
Expand Down

0 comments on commit 6845628

Please sign in to comment.