✅ Test refactoring, make test more stable (#374)
- Move copy-pasted code to User API - Clean the database after each test - Refactor documents search test
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
import { afterAll, afterEach, beforeAll, beforeEach, describe, expect} from "@jest/globals";
|
||||
import { init, TestPlatform } from "../setup";
|
||||
import TestHelpers from "../common/common_test_helpers";
|
||||
import UserApi from "../common/user-api";
|
||||
|
||||
describe("The /users/quota API", () => {
|
||||
let platform: TestPlatform;
|
||||
let currentUser: TestHelpers;
|
||||
let currentUser: UserApi;
|
||||
|
||||
beforeEach(async () => {
|
||||
platform = await init();
|
||||
currentUser = await TestHelpers.getInstance(platform);
|
||||
currentUser = await UserApi.getInstance(platform);
|
||||
}, 30000000);
|
||||
|
||||
afterEach(async () => {
|
||||
|
||||
@@ -3,7 +3,7 @@ import { init, TestPlatform } from "../setup";
|
||||
import { TestDbService } from "../utils.prepare.db";
|
||||
import { v1 as uuidv1 } from "uuid";
|
||||
import { CompanyLimitsEnum } from "../../../src/services/user/web/types";
|
||||
import TestHelpers from "../common/common_test_helpers";
|
||||
import UserApi from "../common/user-api";
|
||||
|
||||
describe("The /users API", () => {
|
||||
const url = "/internal/services/users/v1";
|
||||
@@ -213,7 +213,7 @@ describe("The /users API", () => {
|
||||
});
|
||||
|
||||
it("shouldn't return anonymous accounts ", async () => {
|
||||
const oneUser = await TestHelpers.getInstance(platform, true);
|
||||
const oneUser = await UserApi.getInstance(platform, true);
|
||||
|
||||
const response = await platform.app.inject({
|
||||
method: "GET",
|
||||
|
||||
Reference in New Issue
Block a user