refactor: Upgrade typeorm to 0.3.x (#5151)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2023-01-13 18:12:22 +01:00
committed by GitHub
parent 6608e69457
commit 0a5ab560b1
85 changed files with 579 additions and 636 deletions

View File

@@ -7,23 +7,21 @@ import * as utils from '../shared/utils';
import * as testDb from '../shared/testDb';
let app: express.Application;
let testDbName = '';
let globalOwnerRole: Role;
beforeAll(async () => {
app = await utils.initTestServer({ endpointGroups: ['owner'], applyAuth: true });
const initResult = await testDb.init();
testDbName = initResult.testDbName;
await testDb.init();
globalOwnerRole = await testDb.getGlobalOwnerRole();
});
beforeEach(async () => {
await testDb.truncate(['User'], testDbName);
await testDb.truncate(['User']);
});
afterAll(async () => {
await testDb.terminate(testDbName);
await testDb.terminate();
});
test('user-management:reset should reset DB to default user state', async () => {
@@ -31,7 +29,7 @@ test('user-management:reset should reset DB to default user state', async () =>
await Reset.run();
const user = await Db.collections.User.findOne({ globalRole: globalOwnerRole });
const user = await Db.collections.User.findOneBy({ globalRoleId: globalOwnerRole.id });
if (!user) {
fail('No owner found after DB reset to default user state');