Skip to content

Commit

Permalink
Fix the test cases issue
Browse files Browse the repository at this point in the history
  • Loading branch information
SooryaKumaranC-tw committed Jun 27, 2023
1 parent 7c52d8a commit 995039a
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions ui/test/unit/clinical/controllers/addTreatmentController.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,18 @@ describe("AddTreatmentController", function () {
}));
var DateUtil = Bahmni.Common.Util.DateUtil;

var medicationConfig = {
"commonConfig": {},
"tabConfig": {
"allMedicationTabConfig": {
"orderSet": {
"calculateDoseOnlyOnCurrentVisitValues": false,
"showRulesInMedication":true
},
}
}
};

var activeDrugOrder = {
"uuid": "activeOrderUuid",
"action": "NEW",
Expand Down Expand Up @@ -111,8 +123,7 @@ describe("AddTreatmentController", function () {

var $q, scope, stateParams, rootScope, contextChangeHandler, newTreatment,
editTreatment, clinicalAppConfigService, ngDialog, drugService, drugs,
encounterDateTime, appService, appConfig, defaultDrugsPromise, orderSetService, locationService;

encounterDateTime, appDescriptor, appService, appConfig, defaultDrugsPromise, orderSetService, locationService;

stateParams = {
tabConfigName: null
Expand Down Expand Up @@ -163,6 +174,7 @@ describe("AddTreatmentController", function () {
clinicalAppConfigService.getTreatmentActionLink.and.returnValue([]);
appService = jasmine.createSpyObj('appService', ['getAppDescriptor']);
appConfig = jasmine.createSpyObj('appConfig', ['getConfig']);
appDescriptor = jasmine.createSpyObj('appDescriptor', ['getConfigForPage']);
orderSetService = jasmine.createSpyObj('orderSetService', ['getCalculatedDose', 'getOrderSetsByQuery']);
scope.patient = {uuid: "patient.uuid"};
orderSetService.getCalculatedDose.and.returnValue(specUtil.respondWithPromise($q, {
Expand All @@ -180,6 +192,9 @@ describe("AddTreatmentController", function () {
drugService.getSetMembersOfConcept.and.returnValue(defaultDrugsPromise);

appService.getAppDescriptor.and.returnValue(appConfig);
appService.getAppDescriptor.and.returnValue(appDescriptor);
appDescriptor.getConfigForPage.and.returnValue(medicationConfig);

orderSets = [{
"orderSetId": 3,
"uuid": "497b959b-101b-41a8-8154-3f252b2771d7",
Expand Down Expand Up @@ -232,6 +247,7 @@ describe("AddTreatmentController", function () {
clinicalAppConfigService: clinicalAppConfigService,
ngDialog: ngDialog,
appService: appService,
appDescriptor: appDescriptor,
locationService :locationService,
drugService: drugService,
treatmentConfig: treatmentConfig,
Expand Down

0 comments on commit 995039a

Please sign in to comment.