From b2d96eaa6fe07888282837467a1add097a43c4c1 Mon Sep 17 00:00:00 2001 From: Pedro Silva Date: Wed, 11 Jan 2023 12:45:29 +0000 Subject: [PATCH] Debug tests --- qa-core/scripts/jestSetup.js | 2 ++ .../internal-api/TestConfiguration/applications.ts | 1 + .../internal-api/applications/applications.spec.ts | 12 ++++++------ .../userManagement/appSpecificRoles.spec.ts | 6 +++--- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/qa-core/scripts/jestSetup.js b/qa-core/scripts/jestSetup.js index 77565783c3..851037cc69 100644 --- a/qa-core/scripts/jestSetup.js +++ b/qa-core/scripts/jestSetup.js @@ -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) diff --git a/qa-core/src/config/internal-api/TestConfiguration/applications.ts b/qa-core/src/config/internal-api/TestConfiguration/applications.ts index 1cfd025974..30e08ca173 100644 --- a/qa-core/src/config/internal-api/TestConfiguration/applications.ts +++ b/qa-core/src/config/internal-api/TestConfiguration/applications.ts @@ -58,6 +58,7 @@ export default class AppApi { async create(body: any): Promise> { 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 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 67ca737267..de5f3e1c95 100644 --- a/qa-core/src/tests/internal-api/applications/applications.spec.ts +++ b/qa-core/src/tests/internal-api/applications/applications.spec.ts @@ -12,7 +12,7 @@ describe("Internal API - Application creation, update, publish and delete", () = const accountsAPI = new AccountsAPIClient() const config = new TestConfiguration(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(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(app.appId) }) - it("POST - Revert Changes", async () => { + it("Revert Changes", async () => { const app = await config.applications.create(generateApp()) config.applications.api.appId = app.appId diff --git a/qa-core/src/tests/internal-api/userManagement/appSpecificRoles.spec.ts b/qa-core/src/tests/internal-api/userManagement/appSpecificRoles.spec.ts index c524480398..05ecb9a590 100644 --- a/qa-core/src/tests/internal-api/userManagement/appSpecificRoles.spec.ts +++ b/qa-core/src/tests/internal-api/userManagement/appSpecificRoles.spec.ts @@ -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 @@ -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 @@ -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()