fix backend unit test for ticket.weekly #393

Merged
joan merged 8 commits from 2457-fix_regularizeClaim_unit_test into dev 2020-09-29 12:33:00 +00:00
5 changed files with 7 additions and 8 deletions
Showing only changes of commit 87e4765a1c - Show all commits

View File

@ -8,7 +8,6 @@ describe('route updateVolume()', () => {
let ticketToRestore;
let logIdToDestroy;
afterAll(async done => {
await originalRoute.updateAttributes({m3: 1.8});
await ticketToRestore.updateAttributes({routeFk: null});

View File

@ -2,13 +2,15 @@ const app = require('vn-loopback/server/server');
describe('ticket-weekly filter()', () => {
const authUserId = 9;
it('should return the tickets matching the filter', async() => {
const ctx = {req: {accessToken: {userId: authUserId}}, args: {}};
const filter = {order: 'id DESC'};
const result = await app.models.TicketWeekly.filter(ctx, filter);
it('should all return the tickets matching the filter', async() => {
const filter = {order: 't.id ASC'};
const ctx = {req: {accessToken: {userId: authUserId}}, args: {filter: filter}};
const result = await app.models.TicketWeekly.filter(ctx);
const firstRow = result[0];
expect(firstRow.ticketFk).toEqual(1);
expect(result.length).toEqual(5);
});
it('should return the ticket with id one', async() => {

View File

@ -35,7 +35,6 @@ describe('sale priceDifference()', () => {
error = e;
});
expect(error).toEqual(new UserError(`The sales of this ticket can't be modified`));
});
});

View File

@ -25,7 +25,7 @@ describe('ticket setDeleted()', () => {
expect(error.message).toEqual('You must delete the claim id %d first');
});
it('should delete the ticket, remove the stowaway link and change the stowaway ticket state to "FIXING" and get ride of the itemshelving', async() => {
it('should delete the ticket, remove the stowaway link and change the stowaway ticket state to "FIXING" and get rid of the itemshelving', async() => {
const employeeUser = 110;
const ctx = {
req: {

View File

@ -26,7 +26,6 @@ describe('ticket updateEditableTicket()', () => {
expect(error).toBeDefined();
});
it('should edit the ticket address', async() => {
let ctx = {req: {accessToken: {userId: 9}}};