Fixed test
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
jorgebl 2021-02-23 17:00:31 +01:00
parent 71eeaadb43
commit 7895af8a54
1 changed files with 9 additions and 3 deletions

View File

@ -54,15 +54,21 @@ describe('Travel Component vnTravelCreate', () => {
it(`should do nothing if it hasn't value on response data.`, () => {
controller.travel = {agencyModeFk: 4};
const tomorrow = new Date();
const result = [{}];
const expectedResponse = [{}];
const expectedResponse = [{
agencyModeFk: 4,
warehouseInFk: undefined,
warehouseOutFk: undefined,
dayDuration: 0
}];
const query = `travels/getAverageDays?agencyModeFk=${controller.travel.agencyModeFk}`;
$httpBackend.expectGET(query).respond(expectedResponse);
controller.onShippedChange(tomorrow);
$httpBackend.flush();
expect(expectedResponse).toEqual(result);
expect(controller.travel.warehouseInFk).toEqual(expectedResponse.warehouseInFk);
expect(controller.travel.warehouseOutFk).toEqual(expectedResponse.warehouseOutFk);
expect(controller.travel.dayDuration).toEqual(expectedResponse.dayDuration);
});
it(`should fill the fields when it's selected a date and agency.`, () => {