Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into 2783-itemPriceFixed_advanced_search
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Jorge Padawan 2021-02-11 18:41:41 +01:00
commit 53b06bc464
1 changed files with 9 additions and 4 deletions

View File

@ -2,12 +2,13 @@ const app = require('vn-loopback/server/server');
let UserError = require('vn-loopback/util/user-error');
describe('ticket new()', () => {
let ticket;
let ticketIdsToDelete = [];
let today = new Date();
let ctx = {req: {accessToken: {userId: 1}}};
afterAll(async done => {
await app.models.Ticket.destroyById(ticket.id);
for (id of ticketIdsToDelete)
await app.models.Ticket.destroyById(id);
done();
});
@ -74,7 +75,7 @@ describe('ticket new()', () => {
agencyModeId: 1
};
ticket = await app.models.Ticket.new(ctx,
const ticket = await app.models.Ticket.new(ctx,
params.clientId,
params.shipped,
params.landed,
@ -85,6 +86,8 @@ describe('ticket new()', () => {
let newestTicketIdInFixtures = 21;
ticketIdsToDelete.push(ticket.id);
expect(ticket.id).toBeGreaterThan(newestTicketIdInFixtures);
});
@ -99,7 +102,7 @@ describe('ticket new()', () => {
agencyModeId: null
};
ticket = await app.models.Ticket.new(ctx,
const ticket = await app.models.Ticket.new(ctx,
params.clientId,
params.shipped,
params.landed,
@ -108,6 +111,8 @@ describe('ticket new()', () => {
params.addressId,
params.agencyModeId);
ticketIdsToDelete.push(ticket.id);
expect(ticket.shipped).toEqual(jasmine.any(Date));
});
});