From e4c5e67514f5a0ccc5dbefe639a21977c74100f8 Mon Sep 17 00:00:00 2001 From: Michael Drury Date: Mon, 3 Jul 2023 14:10:18 +0100 Subject: [PATCH] Revert "Add more tests for user settings" --- qa-core/src/internal-api/api/apis/SelfAPI.ts | 18 +++---------- .../tests/users/userManagement.spec.ts | 25 ------------------- 2 files changed, 3 insertions(+), 40 deletions(-) diff --git a/qa-core/src/internal-api/api/apis/SelfAPI.ts b/qa-core/src/internal-api/api/apis/SelfAPI.ts index 022a438249..cd162053a1 100644 --- a/qa-core/src/internal-api/api/apis/SelfAPI.ts +++ b/qa-core/src/internal-api/api/apis/SelfAPI.ts @@ -14,11 +14,10 @@ export default class SelfAPI extends BaseAPI { return [response, json] } - async changeSelfPassword(): Promise<[Response, User]> { - const body = { - password: "newPassword", - } + async changeSelfPassword(body: Partial): Promise<[Response, User]> { const [response, json] = await this.post(`/global/self`, body) + expect(json._id).toEqual(body._id) + expect(json._rev).not.toEqual(body._rev) return [response, json] } @@ -27,15 +26,4 @@ export default class SelfAPI extends BaseAPI { expect(json).toHaveProperty("apiKey") return json } - - async changeUserInfo(body: Partial): Promise<[Response, User]> { - const [response, json] = await this.post(`/global/self`, body) - return [response, json] - } - - async generateApiKey(): Promise<[Response, ApiKeyResponse]> { - const [response, json] = await this.post(`/global/self/api_key`) - expect(json).toHaveProperty("apiKey") - return [response, json] - } } diff --git a/qa-core/src/internal-api/tests/users/userManagement.spec.ts b/qa-core/src/internal-api/tests/users/userManagement.spec.ts index 42bda21102..28096c08c9 100644 --- a/qa-core/src/internal-api/tests/users/userManagement.spec.ts +++ b/qa-core/src/internal-api/tests/users/userManagement.spec.ts @@ -87,29 +87,4 @@ describe("Internal API - User Management & Permissions", () => { expect(changedUserInfoJson.builder?.global).toBeDefined() expect(changedUserInfoJson.builder?.global).toEqual(true) }) - - it("Set First and Last Name", async () => { - const body: Partial = { - firstName: "newFirstName", - lastName: "newLastName", - } - await config.api.self.changeUserInfo(body) - - const [changedUserInfoResponse, changedUserInfoJson] = - await config.api.self.getSelf() - expect(changedUserInfoJson.firstName).toEqual("newFirstName") - expect(changedUserInfoJson.lastName).toEqual("newLastName") - }) - - it("Generate API key", async () => { - await config.api.self.generateApiKey() - }) - - it("Change Password", async () => { - await config.api.self.changeSelfPassword() - const [changedUserInfoResponse, changedUserInfoJson] = - await config.api.self.getSelf() - - await config.login(changedUserInfoJson.email!, "newPassword") - }) })