WIP pass the failed tests.

This commit is contained in:
Ahmed Bouhuolia
2020-05-17 07:08:12 +02:00
parent 00de156c9f
commit 10f636d2bc
77 changed files with 2164 additions and 1403 deletions

37
server/tests/dbInit.js Normal file
View File

@@ -0,0 +1,37 @@
import {
request,
expect,
createTenantFactory,
createTenant,
bindTenantModel,
login,
systemFactory,
dropTenant,
} from '~/testInit';
let tenantWebsite;
let tenantFactory;
let loginRes;
beforeEach(async () => {
tenantWebsite = await createTenant();
tenantFactory = createTenantFactory(tenantWebsite.tenantDb);
bindTenantModel(tenantWebsite.tenantDb);
loginRes = await login(tenantWebsite);
});
afterEach(async () => {
await dropTenant(tenantWebsite);
loginRes = null;
tenantFactory = null;
tenantWebsite = null;
});
export {
tenantWebsite,
tenantFactory,
systemFactory,
loginRes,
};