Merge branch 'dev' of http://git.verdnatura.es/salix into dev
This commit is contained in:
commit
c91163f7d1
|
@ -41,35 +41,39 @@ describe('Ticket', () => {
|
||||||
|
|
||||||
describe('shipped() setter', () => {
|
describe('shipped() setter', () => {
|
||||||
it('should set shipped property and call onChangeShipped() method ', () => {
|
it('should set shipped property and call onChangeShipped() method ', () => {
|
||||||
|
let shipped = new Date();
|
||||||
spyOn(controller, 'onChangeShipped');
|
spyOn(controller, 'onChangeShipped');
|
||||||
controller.ticket = {id: 1};
|
controller.ticket = {id: 1};
|
||||||
controller.shipped = new Date();
|
controller.shipped = shipped;
|
||||||
|
|
||||||
expect(controller.onChangeShipped).toHaveBeenCalledWith(new Date());
|
expect(controller.onChangeShipped).toHaveBeenCalledWith(shipped);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('landed() setter', () => {
|
describe('landed() setter', () => {
|
||||||
it('should set landed property and call onChangeLanded() method ', () => {
|
it('should set landed property and call onChangeLanded() method ', () => {
|
||||||
|
let landed = new Date();
|
||||||
spyOn(controller, 'onChangeLanded');
|
spyOn(controller, 'onChangeLanded');
|
||||||
controller.ticket = {id: 1};
|
controller.ticket = {id: 1};
|
||||||
controller.landed = new Date();
|
controller.landed = landed;
|
||||||
|
|
||||||
expect(controller.onChangeLanded).toHaveBeenCalledWith(new Date());
|
expect(controller.onChangeLanded).toHaveBeenCalledWith(landed);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('onChangeShipped()', () => {
|
describe('onChangeShipped()', () => {
|
||||||
it('should return an available landing date', async () => {
|
it('should return an available landing date', async () => {
|
||||||
|
let shipped = new Date();
|
||||||
|
|
||||||
controller._ticket = {
|
controller._ticket = {
|
||||||
id: 1,
|
id: 1,
|
||||||
shipped: new Date(),
|
shipped: shipped,
|
||||||
addressFk: 121,
|
addressFk: 121,
|
||||||
agencyModeFk: 2,
|
agencyModeFk: 2,
|
||||||
warehouseFk: 1
|
warehouseFk: 1
|
||||||
};
|
};
|
||||||
let data = {
|
let data = {
|
||||||
shipped: toJsonDate(new Date()),
|
shipped: toJsonDate(shipped),
|
||||||
addressFk: 121,
|
addressFk: 121,
|
||||||
agencyModeFk: 2,
|
agencyModeFk: 2,
|
||||||
warehouseFk: 1
|
warehouseFk: 1
|
||||||
|
@ -77,19 +81,20 @@ describe('Ticket', () => {
|
||||||
|
|
||||||
$httpBackend.whenPOST(`/api/Tickets/getLanded`, data).respond(200);
|
$httpBackend.whenPOST(`/api/Tickets/getLanded`, data).respond(200);
|
||||||
$httpBackend.expectPOST(`/api/Tickets/getLanded`, data);
|
$httpBackend.expectPOST(`/api/Tickets/getLanded`, data);
|
||||||
controller.onChangeShipped(new Date());
|
controller.onChangeShipped(shipped);
|
||||||
$httpBackend.flush();
|
$httpBackend.flush();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('onChangeLanded()', () => {
|
describe('onChangeLanded()', () => {
|
||||||
it('should return an available shipment date', async () => {
|
it('should return an available shipment date', async () => {
|
||||||
controller._ticket = {id: 1, landed: new Date(), addressFk: 121, agencyModeFk: 2};
|
let landed = new Date();
|
||||||
let data = {landed: new Date(), addressFk: 121, agencyModeFk: 2};
|
controller._ticket = {id: 1, landed: landed, addressFk: 121, agencyModeFk: 2};
|
||||||
|
let data = {landed: landed, addressFk: 121, agencyModeFk: 2};
|
||||||
|
|
||||||
$httpBackend.whenPOST(`/api/Tickets/getShipped`, data).respond(200);
|
$httpBackend.whenPOST(`/api/Tickets/getShipped`, data).respond(200);
|
||||||
$httpBackend.expectPOST(`/api/Tickets/getShipped`, data);
|
$httpBackend.expectPOST(`/api/Tickets/getShipped`, data);
|
||||||
controller.onChangeLanded(new Date());
|
controller.onChangeLanded(landed);
|
||||||
$httpBackend.flush();
|
$httpBackend.flush();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue