305. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 2/4/2019 11:34:06 AM Eastern Standard Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.

305.1 Files compared

# Location File Last Modified
1 MHPRO_v1.x.zip\mhpro-web-master@18b10e0e051.zip\app\common\js\test provider-authenticated.js Wed Dec 20 15:17:09 2017 UTC
2 MHPRO_v1.x.zip\mhpro-web-master@18b10e0e051.zip\app\common\js\test provider-authenticated.js Mon Feb 4 15:06:51 2019 UTC

305.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 1 652
Changed 1 2
Inserted 0 0
Removed 0 0

305.3 Comparison options

Whitespace
Character case Differences in character case are significant
Line endings Differences in line endings (CR and LF characters) are ignored
CR/LF characters Not shown in the comparison detail

305.4 Active regular expressions

No regular expressions were active.

305.5 Comparison detail

  1   App_Resour ces.hostna me = "http s:// DNS . URL /";
  2   App.TestRe sources =  function ( ) {
  3       var re ady = 0;
  4       var re adyCheck =  function  () {
  5           if  (ready == = 3) { //  set to 3
  6                App.vent .trigger(' test_resou rces:loade d');
  7           }
  8       }
  9       var su ccessMustS tart = fun ction () {
  10           MH PRO.Resour ces.HAReso urces = ne w MHPRO.Co llection.H AResources ();
  11           MH PRO.Resour ces.HAReso urces.fetc h({ succes s: success Handler }) ;
  12  
  13           MH PRO.Resour ces.PVSRes ources = n ew MHPRO.C ollection. PVSResourc es;
  14           MH PRO.Resour ces.PVSRes ources.fet ch({ succe ss: succes sHandler } );
  15  
  16           MH PRO.Resour ces.MHPROR esources =  new MHPRO .Collectio n.MHPRORes ources();
  17           MH PRO.Resour ces.MHPROR esources.f etch({ suc cess: succ essHandler  });
  18       };
  19       var su ccessHandl er = funct ion (colle ction, res ponse, opt ions) {
  20           re ady++;
  21           re adyCheck() ;
  22       };
  23       MHPRO. Resources. App = new  App_Resour ces.Collec tion.AppRe sources(MH PRO_Data.r esource_di rectory.li nks);
  24       succes sMustStart ();
  25   };
  26   describe(" User in Au thenticate d State: " , function  () {
  27       descri be("Resour ces", func tion () {
  28           va r resource sLoaded =  false;
  29           be foreEach(f unction (d one) {
  30                App.vent .on('test_ resources: loaded', f unction ()  {
  31                    reso urcesLoade d = true;
  32                    done ();
  33                });
  34                if (!res ourcesLoad ed) {
  35                    App. TestResour ces();
  36                }
  37                else { d one(); }
  38           }) ;
  39           it ('Resource s Should b e loaded.' , function  () {
  40                expect(r esourcesLo aded).toBe (true);
  41           }) ;
  42       });
  43       descri be("Eula N ot Accepte d", functi on () {
  44           be foreEach(f unction (d one) {
  45                App_Util s.DeleteLo calStorage ('MHPRO_Eu la');
  46                done();
  47           }) ;
  48           it ('Eula sho uld not ex ist', func tion () {
  49                expect(A pp_Utils.G etLocalSto rage('MHPR O_Eula')). toBe(null) ;
  50           }) ;
  51       });
  52       descri be("Eula A ccepted",  function ( ) {
  53           be foreEach(f unction (d one) {
  54                App_Util s.DeleteLo calStorage ('MHPRO_Eu la');
  55                App.vent .on('eula: shown', fu nction ()  {
  56                    App_ Utils.SetL ocalStorag e('MHPRO_E ula', { ac cept_date:  new Date( ).getTime( ) });
  57                    MHPR O.View.Eul a.hide();
  58                })
  59                App.vent .on('eula: hidden', f unction ()  {
  60                    MHPR O.Layout.h eader.show (MHPRO.Vie w.header =  new MHPRO .View.Head er());
  61                    MHPR O.Layout.f ooter.show (new MHPRO .View.foot er());
  62                    MHPR O.Router =  new MHPRO .Router();
  63                    Back bone.histo ry.start() ;
  64                    done ();
  65                });
  66                App.chec kEula();
  67           }) ;
  68           it ('Eula sho uld be set ', functio n () {
  69                expect(A pp_Utils.G etLocalSto rage('MHPR O_Eula')). not.toEqua l(null);
  70           }) ;
  71       });
  72       descri be("Fetch  User objec t", functi on () {
  73           va r user = { };
  74           va r userLoad ed = false ;
  75           be foreEach(f unction (d one) {
  76                //Set Au thorize Re quest head er
  77                App_Util s.SetReque stHeader() ;
  78                if (user Loaded) {  done(); }
  79                App.vent .on('user: loaded', f unction ()  {
  80                    user Loaded = t rue;
  81                    user  = MHPRO.M odel.User. toJSON();
  82                    done ();
  83                });
  84                App.vent .on('user: failed', f unction ()  { done();  });
  85                //Trigge r event to  load user
  86                App.vent .trigger(' load:user' , { init:  true });
  87           }) ;
  88           it ('Users ob ject shoul d contain  mhpuser',  function ( ) {
  89                expect(u ser.mhpuse r).toHaveD ata();
  90           }) ;
  91       });
  92       descri be("Last A ccessed Ti me should  be set", f unction ()  {
  93           be foreEach(f unction (d one) {
  94                App.vent .on('lastA ccessedTim e:success' , function  () { done (); });
  95                App.vent .on('lastA ccessedTim e:failed',  function  () { done( ); });
  96           }) ;
  97           it ('App.Keep AliveTimeL eft greate r than 0',  function  () {
  98                expect(A pp.KeepAli veTimeLeft ).toBeGrea terThan(89 0);
  99           }) ;
  100       });
  101       descri be("Modal  shown at 2  minutes b efore time out", func tion () {
  102           be foreEach(f unction (d one) {
  103                App.vent .on('timeo utModal:vi sible', fu nction ()  {
  104                    done ();
  105                });
  106                App.Keep AliveTimeL eft = 119;
  107           }) ;
  108           it ('Time out  Modal sho uld be vis ible', fun ction () {
  109                expect(c ontainer.f ind('#time out-modal' )).toHaveC lass("in") ;
  110           }) ;
  111           af terEach(fu nction ()  {
  112                App.Keep AliveTimeL eft = 900;
  113           }) ;
  114       });
  115       descri be("Histor ical Graph s", functi on () {
  116           va r viewRend ered = fal se;
  117           be foreEach(f unction (d one) {
  118                if (!vie wRendered)  {
  119                    MHPR O.Router.n avigate("h istoricalG raphs", {
  120                         trigger: t rue,
  121                         replace: t rue
  122                    });
  123                    view Rendered =  true;
  124                    done ();
  125                }
  126                else {
  127                    done ();
  128                }
  129           }) ;
  130           de scribe("Da te Range(s )", functi on () {
  131                var drRe sults = fa lse;
  132                beforeEa ch(functio n (done) {
  133                    if ( !drResults ) {
  134                         setTimeout (function  () {
  135                             var d  = new Date ();
  136                             var no w = new Da te();
  137                             d.setM onth(d.get Month() -  3);
  138                             //$('# viewDataOp tions labe l:nth-chil d(2) input ').trigger ('click');
  139                             $('#st artDate'). val(moment (d).format ("M/D/YYYY "));
  140                             $('#en dDate').va l(moment(n ow).format ("M/D/YYYY "));
  141                             MHPRO. Data.View. historical Graphs.sta te.dateBtn Enabled =  true;
  142                             MHPRO. Data.View. historical Graphs.sta te.numberB tnEnabled  = false;
  143                             $("#DR Btn").prop ("disabled ", false). trigger('c lick');
  144                             drResu lts = true ;
  145                             done() ;
  146                         }, 500);
  147                    }
  148                    else  {
  149                         done();
  150                    }
  151                });
  152   //             it('BA MR should  contain mo re than 1  result', f unction ()  {
  153   //                 ex pect(MHPRO .Data.View .historica lGraphsCha rt.BAMR.da ta.length  > 0).toBeT ruthy();
  154   //             });
  155                it('GAD7  should co ntain more  than 1 re sult', fun ction () {
  156                    expe ct(MHPRO.D ata.View.h istoricalG raphsChart .GAD7.data .length >  0).toBeTru thy();
  157                });
  158                it('PHQ9  should co ntain more  than 1 re sult', fun ction () {
  159                    expe ct(MHPRO.D ata.View.h istoricalG raphsChart .PHQ9.data .length >  0).toBeTru thy();
  160                });
  161                describe ("GAD7 dat e range",  function ( ) {
  162                    var  results =  false;
  163                    befo reEach(fun ction (don e) {
  164                         if (!resul ts) {
  165                             MHPRO. View.histo ricalGraph .filterAss essments() ;
  166                             setTim eout(funct ion () {
  167                                 $( '#GAD7Head er a').tri gger('clic k');
  168                                 re sults = tr ue;
  169                                 do ne();
  170                             }, 250 );
  171                         }
  172                         else {
  173                             done() ;
  174                         }
  175                    });
  176                    it(' Chart shou ld exist',  function  () {
  177                         expect($(' #GAD7Chart ').height( ) > 0 && $ ('#GAD7Cha rt').width () > 0).to BeTruthy() ;
  178                    });
  179                });
  180           }) ;
  181           de scribe("Nu mber of As sessments" , function  () {
  182                var noaR esults = f alse;
  183                beforeEa ch(functio n (done) {
  184                    if ( !noaResult s) {
  185                         setTimeout (function  () {
  186                             $('#vi ewDataOpti ons label: first-chil d input'). trigger('c lick');
  187                             $('#nu mberOfAsse ssments'). val('2');
  188                             MHPRO. Data.View. historical Graphs.sta te.dateBtn Enabled =  false;
  189                             MHPRO. Data.View. historical Graphs.sta te.numberB tnEnabled  = true;
  190                             $('#NO ABtn').pro p("disable d", false) .trigger(' click');
  191                             noaRes ults = tru e;
  192                             done() ;
  193                         }, 250);
  194                    }
  195                    else  {
  196                         done();
  197                    }
  198                });
  199   //             it('BA MR results  to be 2',  function  () {
  200   //                 ex pect(MHPRO .Data.View .historica lGraphsCha rt.BAMR.da ta).toHave Length(2);
  201   //             });
  202                it('GAD7  results t o be 2', f unction ()  {
  203                    expe ct(MHPRO.D ata.View.h istoricalG raphsChart .GAD7.data ).toHaveLe ngth(2);
  204                });
  205                it('PHQ9  results t o be 2', f unction ()  {
  206                    expe ct(MHPRO.D ata.View.h istoricalG raphsChart .PHQ9.data ).toHaveLe ngth(2);
  207                });
  208                describe ("number r ange", fun ction () {
  209                    var  results =  false;
  210                    befo reEach(fun ction (don e) {
  211                         if (!resul ts) {
  212                             MHPRO. View.histo ricalGraph .filterAss essments() ;
  213                             setTim eout(funct ion () {
  214                                 $( '#GAD7Head er a').tri gger('clic k');
  215                                 re sults = tr ue;
  216                                 do ne();
  217                             }, 250 );
  218                         }
  219                         else {
  220                             done() ;
  221                         }
  222                    });
  223                    it(' Chart shou ld exist',  function  () {
  224                         expect($(' #GAD7Chart ').height( ) > 0 && $ ('#GAD7Cha rt').width () > 0).to BeTruthy() ;
  225                    });
  226                });
  227           }) ;
  228           de scribe("GA D7 Number  of Assessm ents", fun ction () {
  229                var resu lts = fals e;
  230                beforeEa ch(functio n (done) {
  231                    if ( !results)  {
  232                         MHPRO.View .historica lGraph.fil terAssessm ents();
  233                         setTimeout (function  () {
  234                             $('#GA D7Header a ').trigger ('click');
  235                             result s = true;
  236                             done() ;
  237                         }, 250);
  238                    }
  239                    else  {
  240                         done();
  241                    }
  242                });
  243                it('GAD- 7 should i nitially s how chart' , function  () {
  244                    expe ct($('#GAD 7Chart').h eight() >  0 && $('#G AD7Chart') .width() >  0).toBeTr uthy();
  245                });
  246                it('GAD- 7 should s how table  on option  click', fu nction ()  {
  247                    $('# GAD7Option s label:nt h-child(2) ').trigger ('click');
  248                    expe ct($('#gad 7-scores') .height()  > 0 && $(' #gad7-scor es').width () > 0).to BeTruthy() ;
  249                });
  250                it('GAD- 7 guide sh own on cli ck', funct ion () {
  251                    $('# GAD7Scores Header a') .trigger(' click');
  252                    expe ct($('#col lapseGAD7  .panel-bod y').height () > 0 &&  $('#collap seGAD7 .pa nel-body') .width() >  0).toBeTr uthy();
  253                });
  254           }) ;
  255           de scribe("PH Q-9 Number  of Assess ments", fu nction ()  {
  256                var resu lts = fals e;
  257                beforeEa ch(functio n (done) {
  258                    if ( !results)  {
  259                         MHPRO.View .historica lGraph.fil terAssessm ents();
  260                         setTimeout (function  () {
  261                             $('#PH Q9Header a ').trigger ('click');
  262                             result s = true;
  263                             done() ;
  264                         }, 250);
  265                    }
  266                    else  {
  267                         done();
  268                    }
  269                });
  270                it('PHQ- 9 should i nitially s how chart' , function  () {
  271                    expe ct($('#PHQ 9Chart').h eight() >  0 && $('#P HQ9Chart') .width() >  0).toBeTr uthy();
  272                });
  273                it('PHQ- 9 should s how table  on option  click', fu nction ()  {
  274                    $('# PHQ9Option s label:nt h-child(2) ').trigger ('click');
  275                    expe ct($('#phq 9-scores') .height()  > 0 && $(' #phq9-scor es').width () > 0).to BeTruthy() ;
  276                });
  277                it('PHQ- 9 guide sh own on cli ck', funct ion () {
  278                    $('# PHQ9Scores Heading a' ).trigger( 'click');
  279                    expe ct($('#col lapsePHQ9  .panel-bod y').height () > 0 &&  $('#collap sePHQ9 .pa nel-body') .width() >  0).toBeTr uthy();
  280                });
  281           }) ;
  282       });
  283  
  284  
  285       //THIS  SHOULD AL WAYS BE LA ST. THIS W ILL KILL T HE SESSION
  286       xdescr ibe("User  times out  or logs ou t of appli cation", f unction ()  {
  287           de scribe("To ken should  be delete d", functi on () {
  288                var toke n = false;
  289                beforeEa ch(functio n (done) {
  290                    App. vent.on('t est-token: deleted',  function ( ) {
  291                         token = tr ue;
  292                         done();
  293                    });
  294                    MHPR O.Model.De leteToken  = new MHPR O.Model.de leteToken( );
  295                    MHPR O.Model.De leteToken. destroy({
  296                         dataType:  "text",
  297                         contentTyp e: false,
  298                         processDat a: false,
  299                         complete:  function ( model, res ponse) {
  300                             App.ve nt.trigger ('test-tok en:deleted ');
  301                         }
  302                    });
  303                });
  304                it('Toke n delete r equest was  successfu l', functi on () {
  305                    expe ct(token). toBe(true) ;
  306                });
  307           }) ;
  308           de scribe("se ssionStora ge token s hould be d eleted", f unction ()  {
  309                var toke n = false;
  310                beforeEa ch(functio n () {
  311                    App_ Utils.Clea rSessionTo ken('token ');
  312                });
  313                it('Toke n is null' , function  () {
  314                    expe ct(App_Uti ls.GetSess ionToken() ).toBe(nul l);
  315                });
  316           }) ;
  317           de scribe("JS ESSIONID c ookie shou ld be dele ted", func tion () {
  318                var cook ie = false ;
  319                beforeEa ch(functio n () {
  320                    App_ Utils.Dele teCookie(' JSESSIONID ');
  321                });
  322                it('Cook ie does no t exist',  function ( ) {
  323                    expe ct(App_Uti ls.CookieE xists('JSE SSIONID')) .toBe(fals e);
  324                });
  325           }) ;
  326       });
  327   });