Commit ec491dafbf746b3b2195221e639097693712a461
1 parent
4dc768e2da
Exists in
master
pre commit
Showing
4 changed files
with
46 additions
and
43 deletions
Show diff stats
spec/controllerSpec.js
... | ... | @@ -7,7 +7,7 @@ describe('Controladores abm vendedor cobrador', function() { |
7 | 7 | inject(function(_$controller_) { |
8 | 8 | $controller = _$controller_; |
9 | 9 | }); |
10 | - }) | |
10 | + }); | |
11 | 11 | describe('controlador focaAbmVendedoresCobradoresController', function() { |
12 | 12 | |
13 | 13 | var focaBotoneraLateralService = { |
... | ... | @@ -61,7 +61,7 @@ describe('Controladores abm vendedor cobrador', function() { |
61 | 61 | var scope = {}; |
62 | 62 | var focaModalService = { |
63 | 63 | confirm: function() { } |
64 | - } | |
64 | + }; | |
65 | 65 | $controller('focaAbmVendedoresCobradoresController', { |
66 | 66 | $scope: scope, |
67 | 67 | focaAbmVendedorCobradorService: {}, |
... | ... | @@ -111,7 +111,8 @@ describe('Controladores abm vendedor cobrador', function() { |
111 | 111 | |
112 | 112 | //arrange |
113 | 113 | promesaConfirmar.then(function() { |
114 | - expect(focaAbmVendedorCobradorService.eliminarVendedorCobrador).toHaveBeenCalled(); | |
114 | + expect(focaAbmVendedorCobradorService.eliminarVendedorCobrador) | |
115 | + .toHaveBeenCalled(); | |
115 | 116 | done(); |
116 | 117 | }); |
117 | 118 | }); |
... | ... | @@ -411,7 +412,7 @@ describe('Controladores abm vendedor cobrador', function() { |
411 | 412 | setTimeout(function() { |
412 | 413 | expect(focaModalService.alert).toHaveBeenCalled(); |
413 | 414 | done(); |
414 | - }, 100) | |
415 | + }, 100); | |
415 | 416 | }); |
416 | 417 | }); |
417 | 418 | |
... | ... | @@ -532,7 +533,7 @@ describe('Controladores abm vendedor cobrador', function() { |
532 | 533 | |
533 | 534 | inject(function($location) { |
534 | 535 | //arrange |
535 | - var scope = {} | |
536 | + var scope = {}; | |
536 | 537 | $controller('focaAbmVendedorCobradorController', { |
537 | 538 | $scope: scope, |
538 | 539 | focaAbmVendedorCobradorService: { |
... | ... | @@ -559,7 +560,7 @@ describe('Controladores abm vendedor cobrador', function() { |
559 | 560 | scope.formVendedorCobrador = { |
560 | 561 | $pristine: true |
561 | 562 | }; |
562 | - scope.cancelar() | |
563 | + scope.cancelar(); | |
563 | 564 | |
564 | 565 | //assert |
565 | 566 | expect($location.url()).toEqual('/vendedor-cobrador'); |
... | ... | @@ -606,7 +607,7 @@ describe('Controladores abm vendedor cobrador', function() { |
606 | 607 | var scope = {}; |
607 | 608 | var uibModal = { |
608 | 609 | open: function() { } |
609 | - } | |
610 | + }; | |
610 | 611 | $controller('focaAbmVendedorCobradorController', { |
611 | 612 | $scope: scope, |
612 | 613 | focaAbmVendedorCobradorService: { |
spec/serviceSpec.js
src/js/controller.js
... | ... | @@ -96,39 +96,40 @@ angular.module('focaAbmVendedorCobrador') |
96 | 96 | |
97 | 97 | return paginas; |
98 | 98 | } |
99 | - | |
100 | - function primera() { | |
101 | - $scope.selectedClientes = 0; | |
102 | - } | |
103 | - | |
104 | - function anterior() { | |
105 | - if ($scope.selectedClientes === 0 && $scope.currentPage > 1) { | |
106 | - retrocederPagina(); | |
107 | - } else { | |
108 | - $scope.selectedClientes--; | |
109 | - } | |
110 | - } | |
111 | - | |
112 | - function siguiente() { | |
113 | - if ($scope.selectedClientes < $scope.currentPageVendedoresCobradores.length - 1 ) { | |
114 | - $scope.selectedClientes++; | |
115 | - } else { | |
116 | - avanzarPagina(); | |
117 | - } | |
118 | - } | |
119 | - | |
120 | - function retrocederPagina() { | |
121 | - if ($scope.currentPage > 1) { | |
122 | - $scope.selectPage($scope.currentPage - 1); | |
123 | - $scope.selectedClientes = $scope.numPerPage - 1; | |
124 | - } | |
125 | - } | |
126 | - | |
127 | - function avanzarPagina() { | |
128 | - if ($scope.currentPage < $scope.lastPage) { | |
129 | - $scope.selectPage($scope.currentPage + 1); | |
130 | - $scope.selectedClientes = 0; | |
131 | - } | |
132 | - } | |
99 | + // TODO: descomentar cuando se use | |
100 | + // function primera() { | |
101 | + // $scope.selectedClientes = 0; | |
102 | + // } | |
103 | + | |
104 | + // function anterior() { | |
105 | + // if ($scope.selectedClientes === 0 && $scope.currentPage > 1) { | |
106 | + // retrocederPagina(); | |
107 | + // } else { | |
108 | + // $scope.selectedClientes--; | |
109 | + // } | |
110 | + // } | |
111 | + | |
112 | + // function siguiente() { | |
113 | + // if ($scope.selectedClientes < $scope.currentPageVendedoresCobradores.length - 1 ) | |
114 | + //{ | |
115 | + // $scope.selectedClientes++; | |
116 | + // } else { | |
117 | + // avanzarPagina(); | |
118 | + // } | |
119 | + // } | |
120 | + | |
121 | + // function retrocederPagina() { | |
122 | + // if ($scope.currentPage > 1) { | |
123 | + // $scope.selectPage($scope.currentPage - 1); | |
124 | + // $scope.selectedClientes = $scope.numPerPage - 1; | |
125 | + // } | |
126 | + // } | |
127 | + | |
128 | + // function avanzarPagina() { | |
129 | + // if ($scope.currentPage < $scope.lastPage) { | |
130 | + // $scope.selectPage($scope.currentPage + 1); | |
131 | + // $scope.selectedClientes = 0; | |
132 | + // } | |
133 | + // } | |
133 | 134 | } |
134 | 135 | ]); |
src/js/service.js
1 | 1 | angular.module('focaAbmVendedorCobrador') |
2 | - .factory('focaAbmVendedorCobradorService', ['$http', 'API_ENDPOINT', function($http, API_ENDPOINT) { | |
2 | + .factory('focaAbmVendedorCobradorService', ['$http', 'API_ENDPOINT', | |
3 | + function($http, API_ENDPOINT) { | |
3 | 4 | return { |
4 | 5 | getVendedoresCobradores: function(nombre) { |
5 | 6 | return $http.post(API_ENDPOINT.URL + '/vendedor-cobrador/list', {nombre: nombre}); |