From 54253c797e2192f489f478e3bcd1da7686ee4267 Mon Sep 17 00:00:00 2001 From: rdurbalauadb <126150793+rdurbalauadb@users.noreply.github.com> Date: Fri, 21 Feb 2025 09:43:26 +0200 Subject: [PATCH 1/3] Update get-binding-details.js --- src/commands/cloudmanager/ip-allowlist/get-binding-details.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands/cloudmanager/ip-allowlist/get-binding-details.js b/src/commands/cloudmanager/ip-allowlist/get-binding-details.js index 4edd72ed..8a8690da 100644 --- a/src/commands/cloudmanager/ip-allowlist/get-binding-details.js +++ b/src/commands/cloudmanager/ip-allowlist/get-binding-details.js @@ -26,7 +26,7 @@ class ListIPAllowlistBindingDetails extends BaseCommand { const result = await this.listIpAllowlists(programId, flags.imsContextName) - const allowList = result.find(allowList => allowList.id === args.ipAllowlistId) + const allowList = result.find(allowList => allowList.id === Number(args.ipAllowlistId)) if (!allowList) { throw new validationCodes.IP_ALLOWLIST_NOT_FOUND({ messageValues: [args.ipAllowlistId, programId] }) From ec8c13403ae382d0306c84bcf5d871c5a3e89124 Mon Sep 17 00:00:00 2001 From: rdurbalauadb <126150793+rdurbalauadb@users.noreply.github.com> Date: Fri, 21 Feb 2025 13:34:03 +0200 Subject: [PATCH 2/3] Update tests for get-binding-details.test.js --- .../ip-allowlist/get-binding-details.test.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/test/commands/ip-allowlist/get-binding-details.test.js b/test/commands/ip-allowlist/get-binding-details.test.js index 1ea3f2df..f5e55ec0 100644 --- a/test/commands/ip-allowlist/get-binding-details.test.js +++ b/test/commands/ip-allowlist/get-binding-details.test.js @@ -37,7 +37,7 @@ test('get-binding-details - not found', async () => { mockSdk.listIpAllowlists = jest.fn(() => Promise.resolve([ { - id: '1', + id: 1, name: 'test1', ipCidrSet: ['1.1.1.1/5', '2.2.2.2/5'], programId: '4', @@ -55,7 +55,7 @@ test('get-binding-details - no bindings', async () => { mockSdk.listIpAllowlists = jest.fn(() => Promise.resolve([ { - id: '1', + id: 1, name: 'test1', ipCidrSet: ['1.1.1.1/5', '2.2.2.2/5'], programId: '4', @@ -84,7 +84,7 @@ test('get-binding-details - normal with bindings', async () => { mockSdk.listIpAllowlists = jest.fn(() => Promise.resolve([ { - id: '1', + id: 1, name: 'test1', ipCidrSet: ['1.1.1.1/5', '2.2.2.2/5'], programId: '4', @@ -98,7 +98,7 @@ test('get-binding-details - normal with bindings', async () => { const runResult = ListIPAllowlistBindingDetails.run(['--programId', '4', '1']) await expect(runResult instanceof Promise).toBeTruthy() await expect(runResult).resolves.toMatchObject({ - id: '1', + id: 1, bindings: [{ environmentId: '3', environmentName: 'TestProgram_dev', @@ -114,7 +114,7 @@ test('get-binding-details - binding to unknown environment (should not ever happ mockSdk.listIpAllowlists = jest.fn(() => Promise.resolve([ { - id: '1', + id: 1, name: 'test1', ipCidrSet: ['1.1.1.1/5', '2.2.2.2/5'], programId: '4', @@ -128,7 +128,7 @@ test('get-binding-details - binding to unknown environment (should not ever happ const runResult = ListIPAllowlistBindingDetails.run(['--programId', '4', '1']) await expect(runResult instanceof Promise).toBeTruthy() await expect(runResult).resolves.toMatchObject({ - id: '1', + id: 1, bindings: [{ environmentId: 'X', environmentName: 'Environment X', @@ -144,7 +144,7 @@ test('get-binding-details - bindings when environment load fails', async () => { mockSdk.listIpAllowlists = jest.fn(() => Promise.resolve([ { - id: '1', + id: 1, name: 'test1', ipCidrSet: ['1.1.1.1/5', '2.2.2.2/5'], programId: '4', @@ -159,7 +159,7 @@ test('get-binding-details - bindings when environment load fails', async () => { const runResult = ListIPAllowlistBindingDetails.run(['--programId', '4', '1']) await expect(runResult instanceof Promise).toBeTruthy() await expect(runResult).resolves.toMatchObject({ - id: '1', + id: 1, bindings: [{ environmentId: 'X', environmentName: 'Environment X', From a7248a508148c07d8633e9a574eae0faac368641 Mon Sep 17 00:00:00 2001 From: rdurbalauadb <126150793+rdurbalauadb@users.noreply.github.com> Date: Fri, 21 Feb 2025 13:37:31 +0200 Subject: [PATCH 3/3] Update get-binding-details.test.js --- test/commands/ip-allowlist/get-binding-details.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/commands/ip-allowlist/get-binding-details.test.js b/test/commands/ip-allowlist/get-binding-details.test.js index f5e55ec0..555d8251 100644 --- a/test/commands/ip-allowlist/get-binding-details.test.js +++ b/test/commands/ip-allowlist/get-binding-details.test.js @@ -66,7 +66,7 @@ test('get-binding-details - no bindings', async () => { const runResult = ListIPAllowlistBindingDetails.run(['--programId', '4', '1']) await expect(runResult instanceof Promise).toBeTruthy() await expect(runResult).resolves.toMatchObject({ - id: '1', + id: 1, bindings: [], }) await expect(mockSdk.listIpAllowlists.mock.calls.length).toEqual(1)