fix ticket-volume

This commit is contained in:
Javi Gallego 2018-05-28 09:30:00 +02:00
parent 8b03ba420f
commit f4423e3fb5
1 changed files with 2 additions and 2 deletions

View File

@ -21,14 +21,14 @@ describe('ticket', () => {
then: () => {} then: () => {}
}; };
}}; }};
$state = _$state_; $state = _$state_;
$state.params.id = 101; $state.params.id = 101;
controller = $componentController('vnTicketVolume', {$scope: $scope}, {$httpBackend: $httpBackend}, {$state: $state}); controller = $componentController('vnTicketVolume', {$scope: $scope}, {$httpBackend: $httpBackend}, {$state: $state});
})); }));
it('should join the sale volumes to its respective sale', () => { it('should join the sale volumes to its respective sale', () => {
controller.ticket = {id: 1}; controller.ticket = {id: 1};
let response = {volumes: [[{saleFk: 1, m3: 0.008}, {saleFk: 2, m3: 0.003}]]}; let response = {volumes: [{saleFk: 1, m3: 0.008}, {saleFk: 2, m3: 0.003}]};
$httpBackend.whenGET(`/api/tickets/1/getVolume`).respond(response); $httpBackend.whenGET(`/api/tickets/1/getVolume`).respond(response);
$httpBackend.expectGET(`/api/tickets/1/getVolume`); $httpBackend.expectGET(`/api/tickets/1/getVolume`);
controller.setVolumes(); controller.setVolumes();