Add test for appDefinition

This commit is contained in:
Pedro Silva 2022-10-11 15:06:04 +01:00
parent d9baa5be66
commit db709c6a4d
1 changed files with 19 additions and 0 deletions

View File

@ -181,4 +181,23 @@ describe("Internal API - /applications endpoints", () => {
const [deleteResponse] = await config.applications.delete(app.appId ? app.appId : "") const [deleteResponse] = await config.applications.delete(app.appId ? app.appId : "")
expect(deleteResponse).toHaveStatusCode(200) expect(deleteResponse).toHaveStatusCode(200)
}) })
it("GET - App Definition", async () => {
const [response, app] = await config.applications.create(generateApp())
expect(response).toHaveStatusCode(200)
expect(app.appId).toBeDefined()
config.applications.api.appId = app.appId
const [definitionResponse, definition] = await config.applications.getAppDefinition(app.appId ? app.appId : "")
expect(definitionResponse).toHaveStatusCode(200)
expect(definition).toEqual({
appId: app.appId,
appUrl: app.url,
name: app.name,
pages: [],
pagesById: {},
routes: {},
theme: {},
})
})
}) })