From 85c835e5f0ded6b883ee9f14b48bada03d65e64f Mon Sep 17 00:00:00 2001 From: Pedro Silva Date: Fri, 12 May 2023 11:14:00 +0100 Subject: [PATCH 1/3] Add status check to license api --- qa-core/src/account-api/api/apis/LicenseAPI.ts | 4 ++++ qa-core/src/internal-api/tests/users/appSpecificRoles.spec.ts | 3 --- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/qa-core/src/account-api/api/apis/LicenseAPI.ts b/qa-core/src/account-api/api/apis/LicenseAPI.ts index f726eb5682..f420ab44b9 100644 --- a/qa-core/src/account-api/api/apis/LicenseAPI.ts +++ b/qa-core/src/account-api/api/apis/LicenseAPI.ts @@ -20,6 +20,10 @@ export default class LicenseAPI { internal: true, } ) + + if (response.status !== 200) { + throw new Error(`License Error: ${response.status}`) + } return [response, json] } } diff --git a/qa-core/src/internal-api/tests/users/appSpecificRoles.spec.ts b/qa-core/src/internal-api/tests/users/appSpecificRoles.spec.ts index c3c9395b78..325735b3fc 100644 --- a/qa-core/src/internal-api/tests/users/appSpecificRoles.spec.ts +++ b/qa-core/src/internal-api/tests/users/appSpecificRoles.spec.ts @@ -11,9 +11,6 @@ describe("Internal API - App Specific Roles & Permissions", () => { await config.beforeAll() }) - afterAll(async () => { - await config.afterAll() - }) afterAll(async () => { await config.afterAll() }) From e792b717c5174b33ce55ec6ff5e4523db86c9595 Mon Sep 17 00:00:00 2001 From: Pedro Silva Date: Fri, 12 May 2023 12:16:48 +0100 Subject: [PATCH 2/3] Update qa-core/src/account-api/api/apis/LicenseAPI.ts Co-authored-by: Rory Powell --- qa-core/src/account-api/api/apis/LicenseAPI.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qa-core/src/account-api/api/apis/LicenseAPI.ts b/qa-core/src/account-api/api/apis/LicenseAPI.ts index f420ab44b9..5540d68c83 100644 --- a/qa-core/src/account-api/api/apis/LicenseAPI.ts +++ b/qa-core/src/account-api/api/apis/LicenseAPI.ts @@ -22,7 +22,7 @@ export default class LicenseAPI { ) if (response.status !== 200) { - throw new Error(`License Error: ${response.status}`) + throw new Error(`Could not update license for accountId=${accountId}: ${response.status}`) } return [response, json] } From 9b8e2718ed7141674ae02285b8c89ef0d79f453a Mon Sep 17 00:00:00 2001 From: Pedro Silva Date: Fri, 12 May 2023 12:27:34 +0100 Subject: [PATCH 3/3] Linting --- qa-core/src/account-api/api/apis/LicenseAPI.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/qa-core/src/account-api/api/apis/LicenseAPI.ts b/qa-core/src/account-api/api/apis/LicenseAPI.ts index 5540d68c83..e0601fe127 100644 --- a/qa-core/src/account-api/api/apis/LicenseAPI.ts +++ b/qa-core/src/account-api/api/apis/LicenseAPI.ts @@ -22,7 +22,9 @@ export default class LicenseAPI { ) if (response.status !== 200) { - throw new Error(`Could not update license for accountId=${accountId}: ${response.status}`) + throw new Error( + `Could not update license for accountId=${accountId}: ${response.status}` + ) } return [response, json] }