Add test for AppPackage

This commit is contained in:
Pedro Silva 2022-11-09 16:05:15 +00:00
parent d1a768791d
commit 604260f622
2 changed files with 16 additions and 1 deletions

View File

@ -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]
}

View File

@ -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(<string>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()