fix backend unit test for ticket.weekly #393
|
@ -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});
|
||||
|
|
|
@ -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() => {
|
||||
|
|
|
@ -35,7 +35,6 @@ describe('sale priceDifference()', () => {
|
|||
error = e;
|
||||
});
|
||||
|
||||
|
||||
expect(error).toEqual(new UserError(`The sales of this ticket can't be modified`));
|
||||
});
|
||||
});
|
||||
|
|
|
@ -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: {
|
||||
|
|
|
@ -26,7 +26,6 @@ describe('ticket updateEditableTicket()', () => {
|
|||
expect(error).toBeDefined();
|
||||
});
|
||||
|
||||
|
||||
it('should edit the ticket address', async() => {
|
||||
let ctx = {req: {accessToken: {userId: 9}}};
|
||||
|
||||
|
|
Loading…
Reference in New Issue