From a185a4850bc367e8f8587f7d22c16ceb470ad987 Mon Sep 17 00:00:00 2001 From: Gyanesh Gouraw Date: Mon, 15 Apr 2024 14:20:10 +0530 Subject: [PATCH] Added unit test for RAR changes --- test/auth/oauth.test.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/test/auth/oauth.test.ts b/test/auth/oauth.test.ts index ec61fc9f3..052d809d8 100644 --- a/test/auth/oauth.test.ts +++ b/test/auth/oauth.test.ts @@ -328,6 +328,25 @@ describe('OAuth', () => { }, }); }); + + it('should send authorization_details when provided', async () => { + const oauth = new OAuth(opts); + await expect( + oauth.pushedAuthorization({ + client_id: 'test-client-id', + response_type: 'code', + redirect_uri: 'https://example.com', + authorization_details: JSON.stringify([ + { type: 'payment_initiation', actions: ['write'] }, + ]), + }) + ).resolves.toMatchObject({ + data: { + request_uri: 'https://www.request.uri', + expires_in: 86400, + }, + }); + }); }); });