Skip to content

Commit ea13b38

Browse files
authored
Merge pull request #77 from OpenLMIS/feature/OE-111
OE-111: fix tests - mock feature flag service
2 parents a72b9cd + 76c0acd commit ea13b38

File tree

38 files changed

+209
-19
lines changed

38 files changed

+209
-19
lines changed

src/admin-reason-add/admin-reason-add-service.spec.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ describe('AdminReasonAddService', function() {
3232
return stockReasonRepositoryMock;
3333
};
3434
});
35+
36+
$provide.value('featureFlagService', {
37+
set: function() {},
38+
get: function() {}
39+
});
3540
});
3641

3742
inject(function($injector) {

src/admin-reason-add/admin-reason-add.controller.spec.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,12 @@ describe('AdminReasonAddController', function() {
2020
programsMap, facilityTypesMap, validReason, ValidReasonAssignmentDataBuilder;
2121

2222
beforeEach(function() {
23-
module('admin-reason-add');
23+
module('admin-reason-add', function($provide) {
24+
$provide.value('featureFlagService', {
25+
set: function() {},
26+
get: function() {}
27+
});
28+
});
2429

2530
inject(function($injector) {
2631
$q = $injector.get('$q');

src/admin-reason-list/reason-list.controller.spec.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,12 @@ describe('ReasonListController', function() {
1818
var vm, $controller, reasons, ReasonDataBuilder;
1919

2020
beforeEach(function() {
21-
module('admin-reason-list');
21+
module('admin-reason-list', function($provide) {
22+
$provide.value('featureFlagService', {
23+
set: function() {},
24+
get: function() {}
25+
});
26+
});
2227

2328
inject(function($injector) {
2429
$controller = $injector.get('$controller');

src/stock-add-products-modal/add-products-modal.controller.spec.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,12 @@ describe('AddProductsModalController', function() {
2020
physicalInventoryDraftCacheService, showInDoses;
2121

2222
beforeEach(function() {
23-
module('stock-add-products-modal');
23+
module('stock-add-products-modal', function($provide) {
24+
$provide.value('featureFlagService', {
25+
set: function() {},
26+
get: function() {}
27+
});
28+
});
2429
module('referencedata');
2530
module('stock-physical-inventory-draft');
2631

src/stock-adjustment-creation/adjustment-creation.controller.spec.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ describe('StockAdjustmentCreationController', function() {
3131
return stockEventRepositoryMock;
3232
};
3333
});
34+
$provide.value('featureFlagService', {
35+
set: function() {},
36+
get: function() {}
37+
});
3438
});
3539

3640
inject(function($injector) {

src/stock-adjustment-creation/adjustment-creation.service.spec.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ describe('stockAdjustmentCreationService', function() {
2525
return stockEventRepositoryMock;
2626
};
2727
});
28+
$provide.value('featureFlagService', {
29+
set: function() {},
30+
get: function() {}
31+
});
2832
});
2933

3034
inject(function($injector) {

src/stock-adjustment-creation/existing-stock-orderable-groups.factory.spec.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,12 @@ describe('existingStockOrderableGroupsFactory', function() {
1919
ProgramDataBuilder, FacilityDataBuilder, OrderableGroupDataBuilder, stateParams;
2020

2121
beforeEach(function() {
22-
module('stock-adjustment-creation');
22+
module('stock-adjustment-creation', function($provide) {
23+
$provide.value('featureFlagService', {
24+
set: function() {},
25+
get: function() {}
26+
});
27+
});
2328
module('referencedata-program');
2429
module('referencedata-facility');
2530

src/stock-adjustment-creation/register-display-items.service.spec.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,12 @@ describe('stockAdjustmentCreationService', function() {
1818
var registerDisplayItemsService, paginationService, paginationItems;
1919

2020
beforeEach(function() {
21-
module('stock-adjustment-creation');
21+
module('stock-adjustment-creation', function($provide) {
22+
$provide.value('featureFlagService', {
23+
set: function() {},
24+
get: function() {}
25+
});
26+
});
2227

2328
inject(function($injector) {
2429
registerDisplayItemsService = $injector.get('registerDisplayItemsService');

src/stock-adjustment-creation/source-destination.service.spec.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ describe('sourceDestinationService', function() {
3131
$provide.factory('localStorageFactory', function() {
3232
return jasmine.createSpy('localStorageFactory').andReturn(storage);
3333
});
34+
35+
$provide.value('featureFlagService', {
36+
set: function() {},
37+
get: function() {}
38+
});
3439
});
3540

3641
inject(function($injector) {

src/stock-card-summary-list/stock-card-summary-list.controller.spec.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ describe('StockCardSummaryListController', function() {
2828
return implMock;
2929
};
3030
});
31+
32+
$provide.value('featureFlagService', {
33+
set: function() {},
34+
get: function() {}
35+
});
3136
});
3237

3338
inject(function($injector) {

0 commit comments

Comments
 (0)