✅ 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:
@@ -36,7 +36,6 @@ export class TestDbService {
|
||||
public company: Company;
|
||||
public users: User[];
|
||||
private workspacesMap: Map<string, { workspace: Workspace; users: User[] }>;
|
||||
private userService;
|
||||
|
||||
rand = () => Math.floor(Math.random() * 100000);
|
||||
private database: DatabaseServiceAPI;
|
||||
@@ -256,6 +255,10 @@ export class TestDbService {
|
||||
return this;
|
||||
}
|
||||
|
||||
async cleanUp() {
|
||||
await this.database.getConnector().drop()
|
||||
}
|
||||
|
||||
getRepository = (type, entity) => {
|
||||
return this.database.getRepository<typeof entity>(type, entity);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user