Merge branch 'dev' of http://git.verdnatura.es/salix into dev

This commit is contained in:
Carlos Jimenez 2018-09-28 13:52:18 +02:00
commit 8ce2912344
1 changed files with 17 additions and 12 deletions

View File

@ -1,19 +1,24 @@
const app = require(`${servicesDir}/client/server/server`);
const restoreFixtures = require(`${servicesDir}/db/testing_fixtures`);
describe('Client Create', () => {
let sqlStatements = {deletes: `
DELETE FROM vn.address WHERE nickname = 'Wade';
DELETE FROM vn.client WHERE name = 'Wade';
DELETE FROM account.user WHERE name = 'Deadpool';
`, inserts: ``, updates: ``};
const clientName = 'Wade';
const AccountName = 'Deadpool';
/* beforeAll(async() => {
let address = await app.models.Address.findOne({where: {nickname: clientName}});
let client = await app.models.Client.findOne({where: {name: clientName}});
let account = await app.models.Account.findOne({where: {name: AccountName}});
await app.models.Address.destroyById(address.id);
await app.models.Client.destroyById(client.id);
await app.models.Account.destroyById(account.id);
}); */
beforeAll(() => {
restoreFixtures(sqlStatements);
});
afterAll(() => {
restoreFixtures(sqlStatements);
afterAll(async() => {
let address = await app.models.Address.findOne({where: {nickname: clientName}});
let client = await app.models.Client.findOne({where: {name: clientName}});
let account = await app.models.Account.findOne({where: {name: AccountName}});
await app.models.Address.destroyById(address.id);
await app.models.Client.destroyById(client.id);
await app.models.Account.destroyById(account.id);
});
let newAccount = {