Debug tests
This commit is contained in:
parent
c090e71ae3
commit
b2d96eaa6f
|
@ -12,8 +12,10 @@ const MOCK_DATE = new Date("2020-01-01T00:00:00.000Z")
|
||||||
const tk = require("timekeeper")
|
const tk = require("timekeeper")
|
||||||
tk.freeze(MOCK_DATE)
|
tk.freeze(MOCK_DATE)
|
||||||
|
|
||||||
|
/*
|
||||||
if (!process.env.DEBUG) {
|
if (!process.env.DEBUG) {
|
||||||
global.console.log = jest.fn() // console.log are ignored in tests
|
global.console.log = jest.fn() // console.log are ignored in tests
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
jest.setTimeout(10000)
|
jest.setTimeout(10000)
|
||||||
|
|
|
@ -58,6 +58,7 @@ export default class AppApi {
|
||||||
async create(body: any): Promise<Partial<App>> {
|
async create(body: any): Promise<Partial<App>> {
|
||||||
const response = await this.api.post(`/applications`, { body })
|
const response = await this.api.post(`/applications`, { body })
|
||||||
const json = await response.json()
|
const json = await response.json()
|
||||||
|
console.log(json)
|
||||||
expect(response).toHaveStatusCode(200)
|
expect(response).toHaveStatusCode(200)
|
||||||
expect(json._id).toBeDefined()
|
expect(json._id).toBeDefined()
|
||||||
return json
|
return json
|
||||||
|
|
|
@ -12,7 +12,7 @@ describe("Internal API - Application creation, update, publish and delete", () =
|
||||||
const accountsAPI = new AccountsAPIClient()
|
const accountsAPI = new AccountsAPIClient()
|
||||||
const config = new TestConfiguration<Application>(api, accountsAPI)
|
const config = new TestConfiguration<Application>(api, accountsAPI)
|
||||||
|
|
||||||
beforeAll(async () => {
|
beforeEach(async () => {
|
||||||
await config.setupAccountAndTenant()
|
await config.setupAccountAndTenant()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -69,7 +69,7 @@ describe("Internal API - Application creation, update, publish and delete", () =
|
||||||
await config.applications.unpublish(<string>app.appId)
|
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())
|
const app = await config.applications.create(generateApp())
|
||||||
config.applications.api.appId = app.appId
|
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())
|
const app = await config.applications.create(generateApp())
|
||||||
config.applications.api.appId = app.appId
|
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())
|
const app = await config.applications.create(generateApp())
|
||||||
|
|
||||||
config.applications.api.appId = app.appId
|
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())
|
const app = await config.applications.create(generateApp())
|
||||||
config.applications.api.appId = app.appId
|
config.applications.api.appId = app.appId
|
||||||
|
|
||||||
await config.applications.revertUnpublished(<string>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())
|
const app = await config.applications.create(generateApp())
|
||||||
config.applications.api.appId = app.appId
|
config.applications.api.appId = app.appId
|
||||||
|
|
||||||
|
|
|
@ -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 api: InternalAPIClient
|
||||||
let accountsAPI: AccountsAPIClient
|
let accountsAPI: AccountsAPIClient
|
||||||
let config: TestConfiguration<Application>
|
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 api: InternalAPIClient
|
||||||
let accountsAPI: AccountsAPIClient
|
let accountsAPI: AccountsAPIClient
|
||||||
let config: TestConfiguration<Application>
|
let config: TestConfiguration<Application>
|
||||||
|
@ -382,7 +382,7 @@ describe("Internal API - App Specific Roles & Permissions", () => {
|
||||||
expect(appPackageJson.screens.length).toEqual(3)
|
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 () => {
|
it("Custom role access for level 1 permissions", async () => {
|
||||||
// Set up user
|
// Set up user
|
||||||
const appUser = generateUser()
|
const appUser = generateUser()
|
||||||
|
|
Loading…
Reference in New Issue