1
0
Fork 0
mirror of synced 2024-10-02 10:08:09 +13:00

Debug tests

This commit is contained in:
Pedro Silva 2023-01-11 12:45:29 +00:00
parent c090e71ae3
commit b2d96eaa6f
4 changed files with 12 additions and 9 deletions

View file

@ -12,8 +12,10 @@ const MOCK_DATE = new Date("2020-01-01T00:00:00.000Z")
const tk = require("timekeeper")
tk.freeze(MOCK_DATE)
/*
if (!process.env.DEBUG) {
global.console.log = jest.fn() // console.log are ignored in tests
}
*/
jest.setTimeout(10000)

View file

@ -58,6 +58,7 @@ export default class AppApi {
async create(body: any): Promise<Partial<App>> {
const response = await this.api.post(`/applications`, { body })
const json = await response.json()
console.log(json)
expect(response).toHaveStatusCode(200)
expect(json._id).toBeDefined()
return json

View file

@ -12,7 +12,7 @@ describe("Internal API - Application creation, update, publish and delete", () =
const accountsAPI = new AccountsAPIClient()
const config = new TestConfiguration<Application>(api, accountsAPI)
beforeAll(async () => {
beforeEach(async () => {
await config.setupAccountAndTenant()
})
@ -69,7 +69,7 @@ describe("Internal API - Application creation, update, publish and delete", () =
await config.applications.unpublish(<string>app.appId)
})
it("POST - Sync application before deployment", async () => {
it("Sync application before deployment", async () => {
const app = await config.applications.create(generateApp())
config.applications.api.appId = app.appId
@ -81,7 +81,7 @@ describe("Internal API - Application creation, update, publish and delete", () =
})
})
it("POST - Sync application after deployment", async () => {
it("Sync application after deployment", async () => {
const app = await config.applications.create(generateApp())
config.applications.api.appId = app.appId
@ -96,7 +96,7 @@ describe("Internal API - Application creation, update, publish and delete", () =
})
})
it("PUT - Update an application", async () => {
it("Update an application", async () => {
const app = await config.applications.create(generateApp())
config.applications.api.appId = app.appId
@ -106,14 +106,14 @@ describe("Internal API - Application creation, update, publish and delete", () =
})
})
it("POST - Revert Changes without changes", async () => {
it("Revert Changes without changes", async () => {
const app = await config.applications.create(generateApp())
config.applications.api.appId = app.appId
await config.applications.revertUnpublished(<string>app.appId)
})
it("POST - Revert Changes", async () => {
it("Revert Changes", async () => {
const app = await config.applications.create(generateApp())
config.applications.api.appId = app.appId

View file

@ -107,7 +107,7 @@ describe("Internal API - App Specific Roles & Permissions", () => {
})
describe("Check Access for default roles", () => {
describe.skip("Check Access for default roles", () => {
let api: InternalAPIClient
let accountsAPI: AccountsAPIClient
let config: TestConfiguration<Application>
@ -223,7 +223,7 @@ describe("Internal API - App Specific Roles & Permissions", () => {
})
})
describe("Screen Access for App specific roles", () => {
describe.skip("Screen Access for App specific roles", () => {
let api: InternalAPIClient
let accountsAPI: AccountsAPIClient
let config: TestConfiguration<Application>
@ -382,7 +382,7 @@ describe("Internal API - App Specific Roles & Permissions", () => {
expect(appPackageJson.screens.length).toEqual(3)
})
})
describe("Screen Access for custom roles", () => {
describe.skip("Screen Access for custom roles", () => {
it("Custom role access for level 1 permissions", async () => {
// Set up user
const appUser = generateUser()