From 1952b9e192bbd2ec2a7897dbc1aa9bb798991e79 Mon Sep 17 00:00:00 2001 From: Shazron Abdullah <36107+shazron@users.noreply.github.com> Date: Mon, 29 Jan 2024 22:45:26 +0800 Subject: [PATCH] fix: meta_scopes --- src/utils.js | 2 +- test/jest.setup.js | 2 +- test/utils.test.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils.js b/src/utils.js index e1bd5c3..0df76e0 100644 --- a/src/utils.js +++ b/src/utils.js @@ -154,7 +154,7 @@ async function generateAuthToken (params = {}) { ims_org_id: imsOrgId, private_key: key.toString(), meta_scopes: [ - finalScopes + ...finalScopes ] } diff --git a/test/jest.setup.js b/test/jest.setup.js index f4bd8d4..e849fee 100644 --- a/test/jest.setup.js +++ b/test/jest.setup.js @@ -9,4 +9,4 @@ OF ANY KIND, either express or implied. See the License for the specific languag governing permissions and limitations under the License. */ -jest.setTimeout(30000) \ No newline at end of file +jest.setTimeout(30000) diff --git a/test/utils.test.js b/test/utils.test.js index 5f45401..0620fe1 100644 --- a/test/utils.test.js +++ b/test/utils.test.js @@ -104,7 +104,7 @@ describe('generateAuthToken', () => { const token = 'my-token' ims.getToken.mockResolvedValue(token) await expect(generateAuthToken(inputs)).resolves.toEqual(token) - expect(ims.context.set).toHaveBeenCalledWith('genToken', {}, true) + expect(ims.context.set).toHaveBeenCalledWith('genToken', expect.objectContaining({ meta_scopes: ['ent_adobeio_sdk'] }), true) }) test('scopes input is not parseable json', async () => {