diff --git a/services/loopback/common/methods/client/specs/createWithUser.spec.js b/services/loopback/common/methods/client/specs/createWithUser.spec.js index d165efe99..2e43d467c 100644 --- a/services/loopback/common/methods/client/specs/createWithUser.spec.js +++ b/services/loopback/common/methods/client/specs/createWithUser.spec.js @@ -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 = {