Test #1549 Arreglar test de back
gitea/salix/dev This commit looks good Details

This commit is contained in:
Bernat 2019-06-21 13:19:51 +02:00
parent 5c152f8813
commit 1227f7ac83
9 changed files with 19 additions and 19 deletions

View File

@ -352,8 +352,8 @@ INSERT INTO `vn`.`creditInsurance`(`id`, `creditClassification`, `credit`, `crea
INSERT INTO `vn`.`route`(`id`, `time`, `workerFk`, `created`, `vehicleFk`, `agencyModeFk`, `description`, `m3`, `cost`, `started`, `finished`) INSERT INTO `vn`.`route`(`id`, `time`, `workerFk`, `created`, `vehicleFk`, `agencyModeFk`, `description`, `m3`, `cost`, `started`, `finished`)
VALUES VALUES
(1, '1899-12-30 12:15:00', 56, CURDATE(), 1, 1, 'first route', 0.1, 10, CURDATE(), CURDATE()), (1, '1899-12-30 12:15:00', 56, CURDATE(), 1, 7, 'first route', 0.1, 10, CURDATE(), CURDATE()),
(2, '1899-12-30 13:20:00', 56, CURDATE(), 1, 1, 'second route', 0.1, 20, CURDATE(), CURDATE()), (2, '1899-12-30 13:20:00', 56, CURDATE(), 1, 7, 'second route', 0.1, 20, CURDATE(), CURDATE()),
(3, '1899-12-30 14:30:00', 56, CURDATE(), 2, 7, 'third route', 0.1, 30, CURDATE(), CURDATE()), (3, '1899-12-30 14:30:00', 56, CURDATE(), 2, 7, 'third route', 0.1, 30, CURDATE(), CURDATE()),
(4, '1899-12-30 15:45:00', 56, CURDATE(), 3, 7, 'fourth route', 0.1, 40, CURDATE(), CURDATE()), (4, '1899-12-30 15:45:00', 56, CURDATE(), 3, 7, 'fourth route', 0.1, 40, CURDATE(), CURDATE()),
(5, '1899-12-30 16:00:00', 56, CURDATE(), 4, 8, 'fifth route', NULL, 50, CURDATE(), CURDATE()), (5, '1899-12-30 16:00:00', 56, CURDATE(), 4, 8, 'fifth route', NULL, 50, CURDATE(), CURDATE()),
@ -429,9 +429,9 @@ INSERT INTO `vn`.`ticket`(`id`, `priority`, `agencyModeFk`,`warehouseFk`,`routeF
(4 , 3, 2, 2, 1, DATE_ADD(CURDATE(), INTERVAL -3 MONTH), DATE_ADD(DATE_ADD(CURDATE(),INTERVAL -3 MONTH), INTERVAL +1 DAY), 104, 'Stark tower', 124, 'T3333333', 0, DATE_ADD(CURDATE(), INTERVAL -3 MONTH)), (4 , 3, 2, 2, 1, DATE_ADD(CURDATE(), INTERVAL -3 MONTH), DATE_ADD(DATE_ADD(CURDATE(),INTERVAL -3 MONTH), INTERVAL +1 DAY), 104, 'Stark tower', 124, 'T3333333', 0, DATE_ADD(CURDATE(), INTERVAL -3 MONTH)),
(5 , 3, 3, 3, 1, DATE_ADD(CURDATE(), INTERVAL -4 MONTH), DATE_ADD(DATE_ADD(CURDATE(),INTERVAL -4 MONTH), INTERVAL +1 DAY), 104, 'Stark tower', 124, 'T4444444', 0, DATE_ADD(CURDATE(), INTERVAL -4 MONTH)), (5 , 3, 3, 3, 1, DATE_ADD(CURDATE(), INTERVAL -4 MONTH), DATE_ADD(DATE_ADD(CURDATE(),INTERVAL -4 MONTH), INTERVAL +1 DAY), 104, 'Stark tower', 124, 'T4444444', 0, DATE_ADD(CURDATE(), INTERVAL -4 MONTH)),
(6 , 1, 3, 3, 1, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), DATE_ADD(DATE_ADD(CURDATE(),INTERVAL -1 MONTH), INTERVAL +1 DAY), 101, 'Mountain Drive Gotham', 1, 'A1111111', 0, DATE_ADD(CURDATE(), INTERVAL -1 MONTH)), (6 , 1, 3, 3, 1, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), DATE_ADD(DATE_ADD(CURDATE(),INTERVAL -1 MONTH), INTERVAL +1 DAY), 101, 'Mountain Drive Gotham', 1, 'A1111111', 0, DATE_ADD(CURDATE(), INTERVAL -1 MONTH)),
(7 , NULL, 4, 4, 2, CURDATE(), DATE_ADD(CURDATE(), INTERVAL + 1 DAY), 101, 'Mountain Drive Gotham', 1, NULL, 0, CURDATE()), (7 , NULL, 7, 1, 2, CURDATE(), DATE_ADD(CURDATE(), INTERVAL + 1 DAY), 101, 'Mountain Drive Gotham', 1, NULL, 0, CURDATE()),
(8 , NULL, 7, 1, 2, CURDATE(), DATE_ADD(CURDATE(), INTERVAL + 1 DAY), 101, 'Bat cave', 121, NULL, 0, CURDATE()), (8 , NULL, 7, 1, 2, CURDATE(), DATE_ADD(CURDATE(), INTERVAL + 1 DAY), 101, 'Bat cave', 121, NULL, 0, CURDATE()),
(9 , NULL, 1, 5, 2, CURDATE(), DATE_ADD(CURDATE(), INTERVAL + 1 DAY), 104, 'Stark tower', 124, NULL, 0, CURDATE()), (9 , NULL, 7, 1, 2, CURDATE(), DATE_ADD(CURDATE(), INTERVAL + 1 DAY), 104, 'Stark tower', 124, NULL, 0, CURDATE()),
(10, 1, 1, 5, 3, CURDATE(), DATE_ADD(CURDATE(), INTERVAL + 1 DAY), 102, 'Ingram Street', 2, NULL, 0, CURDATE()), (10, 1, 1, 5, 3, CURDATE(), DATE_ADD(CURDATE(), INTERVAL + 1 DAY), 102, 'Ingram Street', 2, NULL, 0, CURDATE()),
(11, 1, 7, 1, 3, CURDATE(), DATE_ADD(CURDATE(), INTERVAL + 1 DAY), 102, 'NY roofs', 122, NULL, 0, CURDATE()), (11, 1, 7, 1, 3, CURDATE(), DATE_ADD(CURDATE(), INTERVAL + 1 DAY), 102, 'NY roofs', 122, NULL, 0, CURDATE()),
(12, 1, 1, 1, 3, CURDATE(), DATE_ADD(CURDATE(), INTERVAL + 1 DAY), 103, 'Phone Box', 123, NULL, 0, CURDATE()), (12, 1, 1, 1, 3, CURDATE(), DATE_ADD(CURDATE(), INTERVAL + 1 DAY), 103, 'Phone Box', 123, NULL, 0, CURDATE()),
@ -448,7 +448,7 @@ INSERT INTO `vn`.`ticket`(`id`, `priority`, `agencyModeFk`,`warehouseFk`,`routeF
INSERT INTO `vn`.`ticketObservation`(`id`, `ticketFk`, `observationTypeFk`, `description`) INSERT INTO `vn`.`ticketObservation`(`id`, `ticketFk`, `observationTypeFk`, `description`)
VALUES VALUES
(1, 1, 1, 'ready'), (1, 11, 1, 'ready'),
(2, 2, 2, 'do it fast please'), (2, 2, 2, 'do it fast please'),
(3, 3, 3, 'Faster faster fasteeeeeer!!!'), (3, 3, 3, 'Faster faster fasteeeeeer!!!'),
(4, 4, 3, 'Deliver before 8am'), (4, 4, 3, 'Deliver before 8am'),
@ -1082,9 +1082,9 @@ INSERT INTO `hedera`.`order`(`id`, `date_send`, `customer_id`, `delivery_method_
(4, DATE_ADD(DATE_ADD(CURDATE(),INTERVAL -3 MONTH), INTERVAL +1 DAY), 104, 1, 2, 124, 442, NULL, 'SALIX', 1, DATE_ADD(CURDATE(), INTERVAL -3 MONTH), DATE_ADD(CURDATE(), INTERVAL -3 MONTH), DATE_ADD(CURDATE(), INTERVAL -3 MONTH)), (4, DATE_ADD(DATE_ADD(CURDATE(),INTERVAL -3 MONTH), INTERVAL +1 DAY), 104, 1, 2, 124, 442, NULL, 'SALIX', 1, DATE_ADD(CURDATE(), INTERVAL -3 MONTH), DATE_ADD(CURDATE(), INTERVAL -3 MONTH), DATE_ADD(CURDATE(), INTERVAL -3 MONTH)),
(5, DATE_ADD(DATE_ADD(CURDATE(),INTERVAL -4 MONTH), INTERVAL +1 DAY), 104, 1, 3, 124, 442, NULL, 'SALIX', 1, DATE_ADD(CURDATE(), INTERVAL -4 MONTH), DATE_ADD(CURDATE(), INTERVAL -4 MONTH), DATE_ADD(CURDATE(), INTERVAL -4 MONTH)), (5, DATE_ADD(DATE_ADD(CURDATE(),INTERVAL -4 MONTH), INTERVAL +1 DAY), 104, 1, 3, 124, 442, NULL, 'SALIX', 1, DATE_ADD(CURDATE(), INTERVAL -4 MONTH), DATE_ADD(CURDATE(), INTERVAL -4 MONTH), DATE_ADD(CURDATE(), INTERVAL -4 MONTH)),
(6, DATE_ADD(DATE_ADD(CURDATE(),INTERVAL -1 MONTH), INTERVAL +1 DAY), 101, 1, 3, 1, 442, NULL, 'SALIX', 1, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), DATE_ADD(CURDATE(), INTERVAL -1 MONTH), DATE_ADD(CURDATE(), INTERVAL -1 MONTH)), (6, DATE_ADD(DATE_ADD(CURDATE(),INTERVAL -1 MONTH), INTERVAL +1 DAY), 101, 1, 3, 1, 442, NULL, 'SALIX', 1, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), DATE_ADD(CURDATE(), INTERVAL -1 MONTH), DATE_ADD(CURDATE(), INTERVAL -1 MONTH)),
(7, DATE_ADD(CURDATE(), INTERVAL + 1 DAY), 101, 1, 4, 1, 442, NULL, 'SALIX', 0, CURDATE(), CURDATE(), CURDATE()), (7, DATE_ADD(CURDATE(), INTERVAL + 1 DAY), 101, 2, 7, 1, 442, NULL, 'SALIX', 0, CURDATE(), CURDATE(), CURDATE()),
(8, DATE_ADD(CURDATE(), INTERVAL + 1 DAY), 101, 2, 7, 121, 442, NULL, 'SALIX', 0, CURDATE(), CURDATE(), CURDATE()), (8, DATE_ADD(CURDATE(), INTERVAL + 1 DAY), 101, 2, 7, 121, 442, NULL, 'SALIX', 0, CURDATE(), CURDATE(), CURDATE()),
(9, DATE_ADD(CURDATE(), INTERVAL + 1 DAY), 104, 3, 1, 124, 442, NULL, 'SALIX', 0, CURDATE(), CURDATE(), CURDATE()), (9, DATE_ADD(CURDATE(), INTERVAL + 1 DAY), 104, 2, 7, 124, 442, NULL, 'SALIX', 0, CURDATE(), CURDATE(), CURDATE()),
(10, DATE_ADD(CURDATE(), INTERVAL + 1 DAY), 102, 3, 1, 2, 442, NULL, 'SALIX', 0, CURDATE(), CURDATE(), CURDATE()), (10, DATE_ADD(CURDATE(), INTERVAL + 1 DAY), 102, 3, 1, 2, 442, NULL, 'SALIX', 0, CURDATE(), CURDATE(), CURDATE()),
(11, DATE_ADD(CURDATE(), INTERVAL + 1 DAY), 102, 2, 7, 122, 442, NULL, 'SALIX', 0, CURDATE(), CURDATE(), CURDATE()), (11, DATE_ADD(CURDATE(), INTERVAL + 1 DAY), 102, 2, 7, 122, 442, NULL, 'SALIX', 0, CURDATE(), CURDATE(), CURDATE()),
(12, DATE_ADD(CURDATE(), INTERVAL + 1 DAY), 103, 3, 1, 3, 442, NULL, 'SALIX', 0, CURDATE(), CURDATE(), CURDATE()), (12, DATE_ADD(CURDATE(), INTERVAL + 1 DAY), 103, 3, 1, 3, 442, NULL, 'SALIX', 0, CURDATE(), CURDATE(), CURDATE()),

View File

@ -6,7 +6,7 @@ describe('Ticket descriptor path', () => {
beforeAll(() => { beforeAll(() => {
nightmare nightmare
.loginAndModule('employee', 'ticket'); .loginAndModule('salesperson', 'ticket');
}); });
describe('Delete ticket', () => { describe('Delete ticket', () => {

View File

@ -6,7 +6,7 @@ module.exports = Self => {
arg: 'id', arg: 'id',
type: 'number', type: 'number',
required: true, required: true,
description: 'Guess priority', description: 'Route Id ',
http: {source: 'path'} http: {source: 'path'}
}], }],
returns: { returns: {

View File

@ -111,12 +111,12 @@ describe('Route filter()', () => {
it('should return the routes matching "agencyModeFk"', async() => { it('should return the routes matching "agencyModeFk"', async() => {
let ctx = { let ctx = {
args: { args: {
agencyModeFk: 1, agencyModeFk: 7,
} }
}; };
let result = await app.models.Route.filter(ctx); let result = await app.models.Route.filter(ctx);
expect(result.length).toEqual(2); expect(result.length).toEqual(4);
}); });
}); });

View File

@ -11,7 +11,7 @@ describe('route summary()', () => {
const result = await app.models.Route.summary(1); const result = await app.models.Route.summary(1);
const agency = result.route.agencyMode(); const agency = result.route.agencyMode();
expect(agency.name).toEqual('inhouse pickup'); expect(agency.name).toEqual('Silla247');
}); });
it(`should return a summary object containing it's vehicle`, async() => { it(`should return a summary object containing it's vehicle`, async() => {

View File

@ -11,7 +11,7 @@ describe('route updateVolume()', () => {
afterAll(async done => { afterAll(async done => {
await originalRoute.updateAttributes({m3: 0.1}); await originalRoute.updateAttributes({m3: 0.1});
await ticketToRestore.updateAttributes({routeFk: 4}); await ticketToRestore.updateAttributes({routeFk: 2});
await app.models.RouteLog.destroyById(logIdToDestroy); await app.models.RouteLog.destroyById(logIdToDestroy);
done(); done();
}); });

View File

@ -7,14 +7,14 @@ describe('sale priceDifference()', () => {
tomorrow.setDate(tomorrow.getDate() + 1); tomorrow.setDate(tomorrow.getDate() + 1);
let data = { let data = {
landed: tomorrow, landed: tomorrow,
addressFk: 122, addressFk: 126,
agencyModeFk: 7, agencyModeFk: 7,
warehouseFk: 1 warehouseFk: 1
}; };
let result = await app.models.Sale.priceDifference(11, data); let result = await app.models.Sale.priceDifference(16, data);
expect(result.totalUnitPrice).toEqual(4.13); expect(result.totalUnitPrice).toEqual(22.33);
expect(result.totalNewPrice).toEqual(4.13); expect(result.totalNewPrice).toEqual(22.33);
expect(result.totalDifference).toEqual(0); expect(result.totalDifference).toEqual(0);
}); });

View File

@ -4,7 +4,7 @@ describe('ticket updateEditableTicket()', () => {
const validTicketId = 12; const validTicketId = 12;
const invalidTicketId = 1; const invalidTicketId = 1;
const data = {addressFk: 1}; const data = {addressFk: 1};
const originalData = {addressFk: 121}; const originalData = {addressFk: 123};
afterAll(async done => { afterAll(async done => {
await app.models.Ticket.updateEditableTicket(validTicketId, originalData); await app.models.Ticket.updateEditableTicket(validTicketId, originalData);

View File

@ -22,7 +22,7 @@ class Controller {
.then(() => { .then(() => {
this.cardReload(); this.cardReload();
this.vnApp.showSuccess(this.$translate.instant('Data saved!')); this.vnApp.showSuccess(this.$translate.instant('Data saved!'));
this.$.addStowaway.hide(); this.$.dialog.hide();
}); });
} }