From f2f1579fa9ff9238cd5730b118986e8a26819849 Mon Sep 17 00:00:00 2001 From: Carlos Jimenez <=> Date: Mon, 16 Apr 2018 17:13:58 +0200 Subject: [PATCH] corrected spec descriptions --- .../ticket/src/volume/ticket-volume.spec.js | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/client/ticket/src/volume/ticket-volume.spec.js b/client/ticket/src/volume/ticket-volume.spec.js index 6c438d925..612115a26 100644 --- a/client/ticket/src/volume/ticket-volume.spec.js +++ b/client/ticket/src/volume/ticket-volume.spec.js @@ -22,18 +22,16 @@ describe('ticket', () => { controller = $componentController('vnTicketVolume', {$scope: $scope}, {$httpBackend: $httpBackend}, {$state: $state}); })); - describe('total()', () => { - it('should return the sum from all componenets in each sale', () => { - controller.ticket = {id: 1}; - let response = {volumes: [[{saleFk: 1, m3: 0.008}, {saleFk: 2, m3: 0.003}]]}; - $httpBackend.whenGET(`/api/tickets/1/getVolume`).respond(response); - $httpBackend.expectGET(`/api/tickets/1/getVolume`); - controller.setVolumes(); - $httpBackend.flush(); + it('should join the sale volumes to its respective sale', () => { + controller.ticket = {id: 1}; + let response = {volumes: [[{saleFk: 1, m3: 0.008}, {saleFk: 2, m3: 0.003}]]}; + $httpBackend.whenGET(`/api/tickets/1/getVolume`).respond(response); + $httpBackend.expectGET(`/api/tickets/1/getVolume`); + controller.setVolumes(); + $httpBackend.flush(); - expect($scope.index.model.instances[0].volume.m3).toBe(0.008); - expect($scope.index.model.instances[1].volume.m3).toBe(0.003); - }); + expect($scope.index.model.instances[0].volume.m3).toBe(0.008); + expect($scope.index.model.instances[1].volume.m3).toBe(0.003); }); }); });