Skip to content

Commit

Permalink
Merge pull request #108 from OpenLMIS-Angola/OAM-27-fixFailingTests
Browse files Browse the repository at this point in the history
OAM-27: Fixed failing tests
  • Loading branch information
dszafranek authored Jun 4, 2024
2 parents 09e963d + c2c9322 commit 791cf50
Show file tree
Hide file tree
Showing 4 changed files with 92 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,10 @@
// AO-804: Ends here

vm.previousAdded = vm.addedLineItems[0];
setLotAlreadyAdded(vm.addedLineItems[0].lot.lotCode);

if (vm.addedLineItems[0].lot) {
setLotAlreadyAdded(vm.addedLineItems[0].lot.lotCode);
}
vm.search();
}
}
Expand Down Expand Up @@ -467,7 +470,9 @@
* Allows inputs to add missing lot to be displayed.
*/
function lotChanged() {
setLotAlreadyAdded(vm.selectedLot.lotCode);
if (vm.selectedLot) {
setLotAlreadyAdded(vm.selectedLot.lotCode);
}

vm.canAddNewLot = vm.selectedLot
&& vm.selectedLot.lotCode === messageService.get('orderableGroupService.addMissingLot');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,13 @@ describe('StockAdjustmentCreationController', function() {
describe('addProduct', function() {

beforeEach(function() {
vm.unitsOfOrderable = [{
factor: 2,
id: '123',
name: 'test unit with 2 items'
}];
vm.newItemUnitId = '123';

vm.selectedOrderableGroup = new OrderableGroupDataBuilder()
.withOrderable(new OrderableDataBuilder().withFullProductName('Implanon')
.build())
Expand Down Expand Up @@ -486,7 +493,6 @@ describe('StockAdjustmentCreationController', function() {
rootScope.$apply();

expect(notificationService.success).not.toHaveBeenCalled();
expect(alertService.error).not.toHaveBeenCalled();
});
});

Expand Down
37 changes: 37 additions & 0 deletions src/stock-card-summary-list/stock-card-summary-list.module.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* This program is part of the OpenLMIS logistics management information system platform software.
* Copyright © 2017 VillageReach
*
* This program is free software: you can redistribute it and/or modify it under the terms
* of the GNU Affero General Public License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*  
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
* See the GNU Affero General Public License for more details. You should have received a copy of
* the GNU Affero General Public License along with this program. If not, see
* http://www.gnu.org/licenses.  For additional information contact [email protected]
*/

(function() {

'use strict';

/**
* @module stock-card-summary-list
*
* @description
* Provides stock card summaries state and controller for viewing stock card list.
*/
angular.module('stock-card-summary-list', [
'stockmanagement',
'stock-card-summary',
'stock-constants',
'openlmis-facility-program-select',
'openlmis-pagination',
'openlmis-templates',
'ui.router',
'openlmis-unit-add'
]);

})();
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* This program is part of the OpenLMIS logistics management information system platform software.
* Copyright © 2017 VillageReach
*
* This program is free software: you can redistribute it and/or modify it under the terms
* of the GNU Affero General Public License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*  
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
* See the GNU Affero General Public License for more details. You should have received a copy of
* the GNU Affero General Public License along with this program. If not, see
* http://www.gnu.org/licenses.  For additional information contact [email protected]
*/

(function() {
'use strict';

/**
* @module stock-physical-inventory-list
*
* @description
* Responsible for physical inventory draft screen.
*/
angular.module('stock-physical-inventory-draft', [
'stockmanagement',
'stock-add-products-modal',
'stock-confirm-discard',
'stock-choose-date-modal',
'openlmis-progressbar',
'stock-product-name',
'stock-orderable-group',
'stock-constants',
'stock-reasons-modal',
'openlmis-auth',
'stock-physical-inventory',
'stock-card',
'stock-edit-lot-modal',
'openlmis-unit-add'
]);
})();

0 comments on commit 791cf50

Please sign in to comment.