Produced by Araxis Merge on 11/8/2016 5:24:52 PM 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.
| # | Location | File | Last Modified |
|---|---|---|---|
| 1 | rxrefill-v2.0.0 P2.zip\rxr-web-master.zip\app\common\js\test | base.js | Fri Oct 21 01:05:18 2016 UTC |
| 2 | rxrefill-v2.0.0 P2.zip\rxr-web-master.zip\app\common\js\test | base.js | Mon Oct 31 15:12:35 2016 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 4 | 554 |
| Changed | 3 | 6 |
| Inserted | 0 | 0 |
| Removed | 0 | 0 |
| 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 |
No regular expressions were active.
| 1 | window.RXR = window. RXR || {}; | |
| 2 | //this loa ds fixture s from a f ixtures fo lder | |
| 3 | //relative to where SpecRunner .html live s | |
| 4 | jasmine.ge tFixtures( ).fixtures Path = 'co mmon/js/te st/fixture s/'; | |
| 5 | ||
| 6 | jasmine.ge tJSONFixtu res().fixt uresPath = 'common/j s/test/fix tures/'; | |
| 7 | ||
| 8 | //var jasm ineEnv = j asmine.get Env(); | |
| 9 | ||
| 10 | //jasmineE nv.updateI nterval = 1000; | |
| 11 | ||
| 12 | //containe r-fluid we re our app lives | |
| 13 | setFixture s(sandbox( { | |
| 14 | id: 'c ontainer', | |
| 15 | class: 'containe r-fluid hi dden' | |
| 16 | })); | |
| 17 | ||
| 18 | /*-------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- | |
| 19 | Note to U nit Test D eveloper: | |
| 20 | ||
| 21 | Two sessi on tokens are requir ed to be s et within the test\f ixtures\co nfig.json file | |
| 22 | before ru nning any tests!!! | |
| 23 | ||
| 24 | Log into RXRefill v ia Launchp ad and ope n up the c onsole win dow: | |
| 25 | ||
| 26 | windo w.sessionS torage.tok en = "toke n" | |
| 27 | windo w.sessionS torage.mhv Token = "m hvToken" | |
| 28 | ||
| 29 | After pop ulating th ese values into the config.jso n file, yo u will onl y have 15 minutes | |
| 30 | to run yo ur tests. | |
| 31 | ---------- ---------- ---------- ---------- ---------- ---------- ---------- --------- */ | |
| 32 | var config = getJSON Fixture('c onfig.json '); | |
| 33 | ||
| 34 | App_Utils. SetSession Token("tok en", confi g['token'] ); | |
| 35 | App_Utils. SetSession Token("mhv Token", co nfig['mhvT oken']); | |
| 36 | ||
| 37 | //Set an v ar for con tainer | |
| 38 | var contai ner = $("# container" ); | |
| 39 | //Everythi ng should be ready t o start th at badboy | |
| 40 | //App.star t(); | |
| 41 | ||
| 42 | //Turn off debug opt ion so fin al operati ons are ca lled | |
| 43 | App.debug = false; | |
| 44 | ||
| 45 | function i sEmpty(el) { | |
| 46 | return !$.trim(e l.html()) | |
| 47 | } | |
| 48 | ||
| 49 | RXR.Layout = new RXR .View.layo ut(); | |
| 50 | RXR.Layout .render(); | |
| 51 | RXR.Layout .header.sh ow(RXR.Vie w.Header = new RXR.V iew.header ()); | |
| 52 | RXR.Layout .footer.sh ow(new RXR .View.foot er()); | |
| 53 | App.route = new RXR. Router(); | |
| 54 | Backbone.h istory.sta rt(); | |
| 55 | ||
| 56 | App.loadRe source = f unction () { | |
| 57 | var re ady = 0; | |
| 58 | var re adyCheck = function () { | |
| 59 | if (ready == = 3) { // set to 3 | |
| 60 | App.vent .trigger(' resource:l oaded'); | |
| 61 | } | |
| 62 | }; | |
| 63 | var su ccessMustS tart = fun ction () { | |
| 64 | RX R_Data.HAR esources = new RXR.C ollection. HAResource s(); | |
| 65 | RX R_Data.HAR esources.f etch({ suc cess: succ essHandler }); | |
| 66 | ||
| 67 | RX R_Data.MIL Resources = new RXR. Collection .MILResour ces(); | |
| 68 | RX R_Data.MIL Resources. fetch({ su ccess: suc cessHandle r }); | |
| 69 | ||
| 70 | RX R_Data.RXR Resources = new RXR. Collection .RXRResour ces(); | |
| 71 | RX R_Data.RXR Resources. fetch({ su ccess: suc cessHandle r }); | |
| 72 | }; | |
| 73 | var su ccessHandl er = funct ion (colle ction, res ponse, opt ions) { | |
| 74 | re ady++; | |
| 75 | re adyCheck() ; | |
| 76 | }; | |
| 77 | RXR_Da ta.AppReso urces = ne w App_Reso urces.Coll ection.App Resources( RXR_Data.r esource_di rectory.li nks); | |
| 78 | succes sMustStart (); | |
| 79 | ||
| 80 | }; | |
| 81 | ||
| 82 | var resour cesLoaded = false; | |
| 83 | beforeEach (function (done) { | |
| 84 | App.ve nt.on('res ource:load ed', funct ion () { | |
| 85 | re sourcesLoa ded = true ; | |
| 86 | do ne(); | |
| 87 | }); | |
| 88 | ||
| 89 | if (!r esourcesLo aded) { | |
| 90 | Ap p.loadReso urce(); | |
| 91 | } | |
| 92 | else { done();} | |
| 93 | }); | |
| 94 | ||
| 95 | describe(" RXR", func tion () { | |
| 96 | descri be("Object ", functio n () { | |
| 97 | it ('RXR shou ld be defi ned', func tion () { | |
| 98 | expect(w indow.RXR) .toBeDefin ed(); | |
| 99 | }) ; | |
| 100 | it ('Main Con tainer sho uld exist' , function () { | |
| 101 | expect(c ontainer). toHaveClas s('contain er-fluid') ; | |
| 102 | }) ; | |
| 103 | }); | |
| 104 | descri be("User A uthenticat ed", funct ion() { | |
| 105 | it ('The tok en from th e browser' , function () { | |
| 106 | var myTo ken = App_ Utils.GetS essionToke n('token') ; | |
| 107 | //expect (myToken). toBeDefine d(); | |
| 108 | expect(m yToken).to Equal(jasm ine.anythi ng()); | |
| 109 | }) ; | |
| 110 | ||
| 111 | }); | |
| 112 | descri be("Right of Access" , function () { | |
| 113 | va r roaLoade d = false; | |
| 114 | be foreEach(f unction() { | |
| 115 | App.vent .on('roa:a ccepted', function() { | |
| 116 | roaL oaded = tr ue; | |
| 117 | }); | |
| 118 | }) ; | |
| 119 | ||
| 120 | it ("Right O f Access a ccepted ev ent called ", functio n() { | |
| 121 | //App.ve nt.trigger ('load:use r', {reset :true, ini t: false } ); | |
| 122 | App_Util s.RightOfA ccess(); | |
| 123 | // this will alway s work in debug mode | |
| 124 | expect(r oaLoaded). toBeTruthy (); | |
| 125 | }) ; | |
| 126 | }); | |
| 127 | descri be("RXR-10 89", funct ion () { | |
| 128 | RX R.Layout.m odal.show( RXR.View.E ulaModal = new RXR.V iew.eulaMo dal()); | |
| 129 | de scribe("No Eula loca lStorage s et", funct ion () { | |
| 130 | eulaShow n = false; | |
| 131 | beforeEa ch(functio n (done) { | |
| 132 | App_ Utils.Dele teLocalSto rage('RXR_ Eula'); | |
| 133 | App. vent.on('e ula:shown' , function () { | |
| 134 | eulaShown = true; | |
| 135 | done(); | |
| 136 | }); | |
| 137 | if ( _.isNull(A pp_Utils.G etLocalSto rage('RXR_ Eula'))) { | |
| 138 | RXR.View.E ulaModal.s how(); | |
| 139 | } | |
| 140 | }); | |
| 141 | it('Eula should be shown if no local s torage key is found' , function () { | |
| 142 | expe ct(eulaSho wn).toBe(t rue); | |
| 143 | }); | |
| 144 | }) ; | |
| 145 | de scribe("Eu la localSt orage set" , function () { | |
| 146 | eulaShow n = false; | |
| 147 | beforeEa ch(functio n (done) { | |
| 148 | App_ Utils.SetL ocalStorag e('RXR_Eul a', { acce pt_date: n ew Date(). getTime() }); | |
| 149 | if ( _.isNull(A pp_Utils.G etLocalSto rage('RXR_ Eula'))) { | |
| 150 | eulaShown = true; | |
| 151 | done(); | |
| 152 | } | |
| 153 | else { eulaSho wn = false ; done();} | |
| 154 | }); | |
| 155 | it('Eula should no t be shown if local storage ke y is found ', functio n () { | |
| 156 | expe ct(eulaSho wn).toBe(f alse); | |
| 157 | }); | |
| 158 | }) ; | |
| 159 | de scribe("Se tting Eula ", functio n () { | |
| 160 | beforeEa ch(functio n (done) { | |
| 161 | eula Exists = f alse; | |
| 162 | App_ Utils.Dele teLocalSto rage('RXR_ Eula'); | |
| 163 | App_ Utils.SetL ocalStorag e('RXR_Eul a', { acce pt_date: n ew Date(). getTime() }); | |
| 164 | if ( _.isNull(A pp_Utils.G etLocalSto rage('RXR_ Eula'))) { | |
| 165 | eulaExists = false; | |
| 166 | done(); | |
| 167 | } | |
| 168 | else { eulaExi sts = true ; done(); } | |
| 169 | }); | |
| 170 | it('Eula should se t', functi on () { | |
| 171 | expe ct(eulaExi sts).toBe( true); | |
| 172 | }); | |
| 173 | }) ; | |
| 174 | de scribe("De leting Eul a", functi on () { | |
| 175 | beforeEa ch(functio n (done) { | |
| 176 | eula Exists = t rue; | |
| 177 | App_ Utils.SetL ocalStorag e('RXR_Eul a', { acce pt_date: n ew Date(). getTime() }); | |
| 178 | App_ Utils.Dele teLocalSto rage('RXR_ Eula'); | |
| 179 | if ( _.isNull(A pp_Utils.G etLocalSto rage('RXR_ Eula'))) { | |
| 180 | eulaExists = false; | |
| 181 | done(); | |
| 182 | } | |
| 183 | else { eulaExi sts = true ; done(); } | |
| 184 | }); | |
| 185 | it('Eula should se t', functi on () { | |
| 186 | expe ct(eulaExi sts).toBe( false); | |
| 187 | }); | |
| 188 | }) ; | |
| 189 | }); | |
| 190 | descri be("RXR-10 14", funct ion () { | |
| 191 | va r errorSho wn = false ; | |
| 192 | be foreEach(f unction (d one) { | |
| 193 | if (erro rShown) { done(); } | |
| 194 | App.vent .on('error :shown', f unction (d ata) { | |
| 195 | done (); | |
| 196 | erro rShown = t rue; | |
| 197 | }); | |
| 198 | }) ; | |
| 199 | it ('Error He ader shoul d be displ ayed when error is t hrown', fu nction () { | |
| 200 | App.vent .trigger(' website:er ror', "tes t"); | |
| 201 | var leng th = conta iner.find( "#errorBan ner").chil dren("ul") .children( ).length; | |
| 202 | expect(l ength > 0) .toBe(true ); | |
| 203 | }) ; | |
| 204 | }); | |
| 205 | ||
| 206 | descri be("Links view", fun ction() { | |
| 207 | va r myLinkVi ew = new R XR.View.Li nks(); | |
| 208 | ||
| 209 | be foreEach(f unction(do ne) { | |
| 210 | spyOn(my LinkView, 'render'). and.callTh rough(); | |
| 211 | myLinkVi ew = new R XR.View.Li nks(); | |
| 212 | $('#test -append'). html(myLin kView.rend er().$el); | |
| 213 | done(); | |
| 214 | }) ; | |
| 215 | ||
| 216 | it ("Link vie w should b e defined" , function () { | |
| 217 | expect(myL inkView).t oBeDefined (); | |
| 218 | }) ; | |
| 219 | ||
| 220 | it ("Does the view cont ain a link for My Co mplete Med ication Li st (RXR-56 8)", funct ion() { | |
| 221 | expect($(' #test-appe nd a[href= "https:// DNS . DNS /mhv-porta l-web/anon ymous.port al?_nfpb=t rue&_nfto= false&_pag eLabel=faq sHome#MHVM eds"').len gth).toBe( 1); | |
| 222 | }) ; | |
| 223 | ||
| 224 | it ("Does the view cont ain a link for Blue Button Dow nload (RXR -569)", fu nction() { | |
| 225 | expect($(' #test-appe nd a[href= "https:// DNS . DNS /mhv-porta l-web/anon ymous.port al?_nfpb=t rue&_nfto= false&_pag eLabel=faq sHome#Blue Button"'). length).to Be(1); | |
| 226 | }) ; | |
| 227 | ||
| 228 | it ("Does the view cont ain a link for Healt h Summary (VA Contin uity of Ca re Documen t (CCD)) ( RXR-570)", function( ) { | |
| 229 | expect($(' #test-appe nd a[href= "https:// DNS . DNS /mhv-porta l-web/anon ymous.port al?_nfpb=t rue&_nfto= false&_pag eLabel=faq sHome#CCD" ').length) .toBe(1); | |
| 230 | }) ; | |
| 231 | }); | |
| 232 | ||
| 233 | /* | |
| 234 | descri be("RXR-55 3", functi on() { | |
| 235 | va r history = false; | |
| 236 | va r detailID ; | |
| 237 | be foreEach(f unction (d one) { | |
| 238 | RXR.Layo ut.content .show(new RXR.View.R xHistory); | |
| 239 | App.vent .on('histo ry:loaded' , function () { | |
| 240 | hist ory = true ; | |
| 241 | deta ilID = RXR .Data.View .RxHistory .items[0]. prescripti onId; | |
| 242 | done (); | |
| 243 | }); | |
| 244 | App.vent .on('histo ry:failed' , function () { | |
| 245 | hist ory = fals e; | |
| 246 | done (); | |
| 247 | }); | |
| 248 | App.vent .trigger(' enterprise Session:lo aded', { i nit: true }); | |
| 249 | }) ; | |
| 250 | ||
| 251 | it ("Prescrip tion Detai l loaded", function( ) { | |
| 252 | expect(R XR.Data.Vi ew.RxHisto ry.items). toBeDefine d(); | |
| 253 | expect(d etailID).t oBeDefined (); | |
| 254 | // first populate the histor y grid | |
| 255 | //$('#te st-append' ).html(RXR .Template. RxHistory( RXR.Data.V iew.RxHist ory)); | |
| 256 | // next get the fi rst hyperl ink and sp lit it int o an array | |
| 257 | //var de tailHref = $('.med-c ontainer a ')[0].href .split('/' ); | |
| 258 | //consol e.log("det ailHref", detailHref ); | |
| 259 | ||
| 260 | ||
| 261 | //expect (detailHre f.length). toBeGreate rThan(0); | |
| 262 | //var de tailId = d etailHref[ detailHref .length - 1]; | |
| 263 | //consol e.log("det ailId: " + detailId) ; | |
| 264 | ||
| 265 | // while the view data is st ill in mem ory load d etail page | |
| 266 | ||
| 267 | $('#test -append'). html(new R XR.View.Rx Detail({id :detailID} ).render() .$el); | |
| 268 | //consol e.log("htm l:" + $('# test-appen d').html() ); | |
| 269 | expect($ ('#' + det ailID).len gth).toEqu al(1); | |
| 270 | }) ; | |
| 271 | }); | |
| 272 | */ | |
| 273 | }); | |
| 274 | ||
| 275 | ||
| 276 | ||
| 277 | ||
| 278 | ||
| 279 | ||
| 280 |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.