Skip to content

Commit

Permalink
Radhakrishna, Keerthi | MOBN-2408 | add. mockAppDescriptor in visitCo…
Browse files Browse the repository at this point in the history
…ntroller test file (#82)
  • Loading branch information
keerthi-magantii authored Jun 28, 2024
1 parent 4329861 commit e214da9
Showing 1 changed file with 23 additions and 14 deletions.
37 changes: 23 additions & 14 deletions ui/test/unit/clinical/common/controllers/visitController.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ describe('VisitController', function () {
var $timeout;
var getEncounterPromise;
var locationService;
var programConfig;
var configurations = {
encounterConfig: function () {
}
Expand All @@ -29,7 +30,15 @@ describe('VisitController', function () {
}
}
};

var mockAppDescriptor = jasmine.createSpyObj('appDescriptor', ['getConfigValue']);
var mockAppService = jasmine.createSpyObj("appService", ["getAppDescriptor"]);

beforeEach(function() {
mockAppDescriptor.getConfigValue.and.returnValue(programConfig);
mockAppService.getAppDescriptor.and.returnValue(mockAppDescriptor);
});

beforeEach(module('bahmni.clinical'));
beforeEach(module('stateMock'));
beforeEach(inject(['$injector', '$timeout', '$q', '$rootScope', '$state', function ($injector, timeout, $q, $rootScope, $state) {
Expand Down Expand Up @@ -70,20 +79,20 @@ describe('VisitController', function () {
});
scope.currentProvider = {uuid: ''};
controller = $controller('VisitController', {
$scope: scope,
$state: state,
encounterService: encounterService,
clinicalAppConfigService: clinicalAppConfigService,
visitSummary: {},
configurations: configurations,
$timeout: $timeout,
printer: {},
visitConfig: visitTabConfig,
visitHistory:[],
$stateParams: {},
locationService: locationService,
appService: mockAppService
});
$scope: scope,
$state: state,
encounterService: encounterService,
clinicalAppConfigService: clinicalAppConfigService,
visitSummary: {},
configurations: configurations,
$timeout: $timeout,
printer: {},
visitConfig: visitTabConfig,
visitHistory:[],
$stateParams: {},
locationService: locationService,
appService: mockAppService
});
}]));

var defaultTab = {
Expand Down

0 comments on commit e214da9

Please sign in to comment.