From d79e1543b58f265c26368ed4962d0c46c22c5b14 Mon Sep 17 00:00:00 2001 From: Pedro Silva Date: Wed, 9 Nov 2022 16:05:15 +0000 Subject: [PATCH] Add test for AppPackage --- .../TestConfiguration/applications.ts | 2 +- .../applications/applications.spec.ts | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/qa-core/src/config/internal-api/TestConfiguration/applications.ts b/qa-core/src/config/internal-api/TestConfiguration/applications.ts index bebf79dd97..c9930e9981 100644 --- a/qa-core/src/config/internal-api/TestConfiguration/applications.ts +++ b/qa-core/src/config/internal-api/TestConfiguration/applications.ts @@ -41,7 +41,7 @@ export default class AppApi { const response = await this.api.get(`/applications/${appId}/appPackage`) const json = await response.json() expect(response).toHaveStatusCode(200) - expect(json.application.apppId).toBe(appId) + expect(json.application.appId).toEqual(appId) return [response, json] } diff --git a/qa-core/src/tests/internal-api/applications/applications.spec.ts b/qa-core/src/tests/internal-api/applications/applications.spec.ts index 93c2121598..48e2727926 100644 --- a/qa-core/src/tests/internal-api/applications/applications.spec.ts +++ b/qa-core/src/tests/internal-api/applications/applications.spec.ts @@ -41,6 +41,21 @@ describe("Internal API - Application creation, update, publish and delete", () = await config.applications.fetch() }) + it("Get application details", async () => { + const app = await config.applications.create({ + ...generateApp(), + useTemplate: false, + }) + config.applications.api.appId = app.appId + + const [appPackageResponse, appPackageJson] = await config.applications.getAppPackage(app.appId) + expect(appPackageJson.application.name).toEqual(app.name) + expect(appPackageJson.application.version).toEqual(app.version) + expect(appPackageJson.application.url).toEqual(app.url) + expect(appPackageJson.application.tenantId).toEqual(app.tenantId) + expect(appPackageJson.application.status).toEqual(app.status) + }) + it("Publish app", async () => { // create the app const appName = generator.word()