11'use strict' ;
22
33describe ( "ManageProgramController" , function ( ) {
4-
54 var scope , messageService , i = 0 , programService , _provide , deferred , q , _spinner ,
65 retrospectiveEntryService , listOfPatientPrograms , programAttributeTypes , allPrograms ,
76 controller , rootScope , confirmBox , state , translate ;
@@ -289,7 +288,6 @@ describe("ManageProgramController", function () {
289288 ]
290289 }
291290 ] ;
292-
293291 } ) ;
294292
295293 it ( "should update active programs list" , function ( ) {
@@ -316,7 +314,7 @@ describe("ManageProgramController", function () {
316314 it ( "Should return minimum start date of states" , function ( ) {
317315 scope . $apply ( setUp ) ;
318316 var maxDate = scope . getMaxAllowedDate ( listOfPatientPrograms . activePrograms [ 0 ] . states ) ;
319- expect ( maxDate ) . toEqual ( '2015-07-01' )
317+ expect ( maxDate ) . toEqual ( '2015-07-01' ) ;
320318 } ) ;
321319
322320 it ( "Should return current date when there are no states" , function ( ) {
@@ -327,7 +325,6 @@ describe("ManageProgramController", function () {
327325 } ) ;
328326
329327 describe ( "Remove program states" , function ( ) {
330-
331328 it ( "should remove latest program state" , function ( ) {
332329 scope . $apply ( setUp ) ;
333330 scope . removePatientState ( listOfPatientPrograms . activePrograms [ 0 ] ) ;
@@ -350,14 +347,13 @@ describe("ManageProgramController", function () {
350347
351348 expect ( programService . updatePatientProgram ) . toHaveBeenCalledWith ( programToBeUpdated , scope . programAttributeTypes , null ) ;
352349 } ) ;
353-
354350 } ) ;
355351
356352 describe ( "updatePatientProgram" , function ( ) {
357353 it ( "should assign the initial state successfully" , function ( ) {
358354 scope . $apply ( setUp ) ;
359355 var patientProgramToBeUpdated = listOfPatientPrograms . activePrograms [ 0 ] ;
360- patientProgramToBeUpdated . states = [ ] ; //making sure there are no states assigned
356+ patientProgramToBeUpdated . states = [ ] ; // making sure there are no states assigned
361357
362358 var newStateUuid = '8917ab09-52b4-4573-aefa-7f6e7bdf6d61' ;
363359 patientProgramToBeUpdated . selectedState = { uuid : newStateUuid } ;
@@ -372,13 +368,12 @@ describe("ManageProgramController", function () {
372368 expect ( patientProgramToBeUpdated . states [ 0 ] . startDate ) . toBe ( Bahmni . Common . Util . DateUtil . parseLongDateToServerFormat ( "2015-07-19" ) ) ;
373369 expect ( patientProgramToBeUpdated . states [ 0 ] . state . uuid ) . toBe ( newStateUuid ) ;
374370 expect ( messageService . showMessage ) . toHaveBeenCalledWith ( "info" , "CLINICAL_SAVE_SUCCESS_MESSAGE_KEY" ) ;
375-
376371 } ) ;
377372
378373 it ( "should update patient program without any state if not provided" , function ( ) {
379374 scope . $apply ( setUp ) ;
380375 var patientProgramToBeUpdated = listOfPatientPrograms . activePrograms [ 0 ] ;
381- patientProgramToBeUpdated . states = [ ] ; //making sure there are no states assigned
376+ patientProgramToBeUpdated . states = [ ] ; // making sure there are no states assigned
382377
383378 patientProgramToBeUpdated . selectedState = undefined ;
384379 retrospectiveEntryService . getRetrospectiveDate . and . callFake ( function ( ) {
@@ -390,7 +385,6 @@ describe("ManageProgramController", function () {
390385 scope . $digest ( ) ;
391386 expect ( patientProgramToBeUpdated . states . length ) . toBe ( 0 ) ;
392387 expect ( messageService . showMessage ) . toHaveBeenCalledWith ( "info" , "CLINICAL_SAVE_SUCCESS_MESSAGE_KEY" ) ;
393-
394388 } ) ;
395389
396390 it ( "should validate if state to be transited is starting after the current running state" , function ( ) {
@@ -413,7 +407,6 @@ describe("ManageProgramController", function () {
413407 var patientProgramToBeUpdated = listOfPatientPrograms . activePrograms [ 0 ] ;
414408 retrospectiveEntryService . getRetrospectiveDate . and . callFake ( function ( ) {
415409 return '2015-07-19' ;
416-
417410 } ) ;
418411 var newStateUuid = '8417ab09-52b4-4573-aefa-7f6e7bdf6d61' ;
419412 expect ( patientProgramToBeUpdated . states . length ) . toBe ( 2 ) ;
@@ -435,7 +428,6 @@ describe("ManageProgramController", function () {
435428 var patientProgramToBeUpdated = listOfPatientPrograms . activePrograms [ 0 ] ;
436429 retrospectiveEntryService . getRetrospectiveDate . and . callFake ( function ( ) {
437430 return '2015-07-19' ;
438-
439431 } ) ;
440432 var currentActiveStateUuid = '1317ab09-52b4-4573-aefa-7f6e7bdf6d61' ;
441433 expect ( patientProgramToBeUpdated . states . length ) . toBe ( 2 ) ;
@@ -458,7 +450,6 @@ describe("ManageProgramController", function () {
458450 var patientProgramToBeUpdated = listOfPatientPrograms . activePrograms [ 0 ] ;
459451 retrospectiveEntryService . getRetrospectiveDate . and . callFake ( function ( ) {
460452 return '2015-07-19' ;
461-
462453 } ) ;
463454 programService . updatePatientProgram . and . callFake ( function ( ) {
464455 deferred = q . defer ( ) ;
@@ -471,12 +462,9 @@ describe("ManageProgramController", function () {
471462 scope . $digest ( ) ;
472463 expect ( messageService . showMessage ) . toHaveBeenCalledWith ( "error" , "Failed to Save" ) ;
473464 } ) ;
474-
475-
476465 } ) ;
477466
478467 describe ( "end program" , function ( ) {
479-
480468 it ( "should validate if program is ending before the current running state" , function ( ) {
481469 scope . $apply ( setUp ) ;
482470 var programToBeUpdated = listOfPatientPrograms . activePrograms [ 0 ] ;
@@ -513,7 +501,7 @@ describe("ManageProgramController", function () {
513501
514502 expect ( scope . programWorkflowStates . length ) . toBe ( 2 ) ;
515503 expect ( scope . patientProgramAttributes ) . toEqual ( { } ) ;
516- } )
504+ } ) ;
517505 } ) ;
518506
519507 describe ( 'get workflows' , function ( ) {
@@ -566,7 +554,7 @@ describe("ManageProgramController", function () {
566554 name : 'TB Program' ,
567555 uuid : 'someUuid'
568556 } ;
569- expect ( scope . isIncluded ( attribute ) ) . toBeFalsy ( )
557+ expect ( scope . isIncluded ( attribute ) ) . toBeFalsy ( ) ;
570558 } ) ;
571559
572560 it ( 'should show attributeType for selected program if it is not excluded in the config' , function ( ) {
@@ -581,7 +569,7 @@ describe("ManageProgramController", function () {
581569 name : 'TB Program' ,
582570 uuid : 'someUuid'
583571 } ;
584- expect ( scope . isIncluded ( attribute ) ) . toBeTruthy ( )
572+ expect ( scope . isIncluded ( attribute ) ) . toBeTruthy ( ) ;
585573 } ) ;
586574 } ) ;
587575} ) ;
0 commit comments