Produced by Araxis Merge on 10/5/2018 9:05:46 PM Central Daylight 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 | MHEDP3_VAOS_VATS_SM_Sept2018.zip\SM 2.4.0\scheduling-manager-web-2.4.0.zip\scheduling-manager\test\specs\app\modules\booking\calendar\adhoc-video-visit\create-new-video-visit | formView-spec.js | Thu Jul 19 16:14:00 2018 UTC |
| 2 | MHEDP3_VAOS_VATS_SM_Sept2018.zip\SM 2.4.0\scheduling-manager-web-2.4.0.zip\scheduling-manager\test\specs\app\modules\booking\calendar\adhoc-video-visit\create-new-video-visit | formView-spec.js | Fri Oct 5 16:56:04 2018 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 548 |
| Changed | 1 | 2 |
| 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 | /*jslint n ode: true, nomen: tr ue, unpara m: true */ | |
| 2 | /*global d efine, des cribe, it, expect, b eforeEach, afterEach , spyOn, j asmine */ | |
| 3 | ||
| 4 | 'use stric t'; | |
| 5 | ||
| 6 | // Jasmine Unit Test ing Suite | |
| 7 | define(["G lobal", "L ayout", "V ideoVisitA ppt", "Dem ographicsC ollection" , "Appoint mentReques t", "Creat eNewVideoV isitFormVi ew"], | |
| 8 | fu nction (Gl obal, Layo ut, ApptMo del, Demog raphicsCol lection, A ppointment Request, F ormView) { | |
| 9 | desc ribe("adho c-video-vi sit Form V iew", func tion () { | |
| 10 | ||
| 11 | // TOD O this sho uld not be here. | |
| 12 | var vi ew; | |
| 13 | var ap ptsCollect ion = new Backbone.C ollection( ); | |
| 14 | var vi deoVisitFa cilityMode l = new Ba ckbone.Mod el({ | |
| 15 | timezone : 'EST' | |
| 16 | }); | |
| 17 | var pa tientIdent ifierModel = new Bac kbone.Mode l({ | |
| 18 | uniqueId : '1234', | |
| 19 | assignin gAuthority : 'abc' | |
| 20 | }); | |
| 21 | var de mographics Collection = new Dem ographicsC ollection( { | |
| 22 | "_id " : "59779 40e0cf2367 37a314123" , | |
| 23 | "pat ientIdenti fier" : { | |
| 24 | "u niqueId" : "aaa", | |
| 25 | "a ssigningAu thority" : "EDIPI" | |
| 26 | }, | |
| 27 | "las tModifiedD ate" : "07 /25/2017 1 7:35:14", | |
| 28 | "ema ilAddress" : "", | |
| 29 | "add ress" : { }, | |
| 30 | "pho nes" : [ { | |
| 31 | "n umber" : " 2345678905 ", | |
| 32 | "t ype" : "Wo rk", | |
| 33 | "o bject-type " : "Phone Number", | |
| 34 | "l ink" : [ ] | |
| 35 | } ], | |
| 36 | "obj ect-type" : "Demogra phic", | |
| 37 | "lin k" : [ { | |
| 38 | "t itle" : "d emographic -detail", | |
| 39 | "href" : " https:// IP /PatientPr ofileServi ces/rest/v 1/patient/ EDIPI/VARP ATIENT25/d emographic s/id/59779 40e0cf2367 37a314123" , | |
| 40 | "o bject-type " : "AtomL ink" | |
| 41 | } ] | |
| 42 | }, {pa rse: true} ); | |
| 43 | var mo del = new ApptModel( { | |
| 44 | dateTime : new Date (2016, 11, 17, 17, 0 , 0), | |
| 45 | duration : 20, | |
| 46 | patients : { | |
| 47 | patient: [ { | |
| 48 | na me: { | |
| 49 | fi rstName: ' Write', | |
| 50 | la stName: 'U nit-Tests' | |
| 51 | }, | |
| 52 | contac tInformati on: { | |
| 53 | pref erredEmail : 'abc@123 .com' | |
| 54 | } | |
| 55 | }] | |
| 56 | }, | |
| 57 | timeZone : 'EST', | |
| 58 | pati ent: { | |
| 59 | name: { | |
| 60 | firstN ame: 'Writ e', | |
| 61 | lastNa me: 'Unit- Tests' | |
| 62 | } | |
| 63 | }, | |
| 64 | provider s: { | |
| 65 | provider: [{ | |
| 66 | na me: { | |
| 67 | firs tName: 'Da ve', | |
| 68 | last Name: 'Ros sberg' | |
| 69 | }, | |
| 70 | co ntactInfor mation: { | |
| 71 | pref erredEmail : 'provide r@test.com ', | |
| 72 | time Zone: 'EST ' | |
| 73 | }, | |
| 74 | lo cation: { | |
| 75 | faci lity: { | |
| 76 | name: 'WALTER RE ED VAMC', | |
| 77 | timeZo ne: 'EST' | |
| 78 | } | |
| 79 | } | |
| 80 | }] | |
| 81 | } | |
| 82 | }); | |
| 83 | ||
| 84 | var $v iew; | |
| 85 | ||
| 86 | var la yout = new Layout(); | |
| 87 | ||
| 88 | descri be("", fun ction () { | |
| 89 | beforeAl l(function () { | |
| 90 | Appointmen tRequest.i nstance(). set({ | |
| 91 | ph oneNumber: '12345678 90', | |
| 92 | em ail: 'pati ent@test.c om' | |
| 93 | }); | |
| 94 | ||
| 95 | view = new FormView( { | |
| 96 | mo del: model , | |
| 97 | ap ptsCollect ion: appts Collection , | |
| 98 | vi deoVisitFa cilityMode l: videoVi sitFacilit yModel, | |
| 99 | pa tientIdent ifierModel : patientI dentifierM odel, | |
| 100 | de mographics Collection : demograp hicsCollec tion | |
| 101 | }); | |
| 102 | ||
| 103 | layout.con tentRegion .show(view ); | |
| 104 | $view = vi ew.$el; | |
| 105 | }); | |
| 106 | ||
| 107 | afterAll (function( ) { | |
| 108 | view.close (); | |
| 109 | Appointmen tRequest.i nstance(). clear(); | |
| 110 | }); | |
| 111 | ||
| 112 | it("has a heading" , function () { | |
| 113 | expect($vi ew.find('h 3').text() ).toEqual( 'Create Vi deo Visit' ); | |
| 114 | }); | |
| 115 | ||
| 116 | it("has a section for valida tion", fun ction() { | |
| 117 | expect($vi ew.find('. validation -required- legend').t ext()).toE qual('* Re quired fie lds'); | |
| 118 | ||
| 119 | expect($vi ew.find('. error-sect ion:hidden ').length) .toBe(1); | |
| 120 | expect($vi ew.find('. error-sect ion .error -list-desc ription'). text()).to Equal('The following errors we re found:' ); | |
| 121 | expect($vi ew.find('. error-sect ion ul.err or-list'). length).to Be(1); | |
| 122 | }); | |
| 123 | ||
| 124 | it("has a form fie lds with d efault val ues", func tion() { | |
| 125 | // Facilit y | |
| 126 | expect($vi ew.find('[ for="video -visit-fac ility"]'). text()).to Equal('Fac ility'); | |
| 127 | expect($vi ew.find('# video-visi t-facility ').text()) .toEqual(' WALTER REE D VAMC'); | |
| 128 | ||
| 129 | // Date, T ime | |
| 130 | expect($vi ew.find('[ for="video -visit-dat e"]').text ()).toEqua l('*\u00a0 Date'); | |
| 131 | expect($vi ew.find('# video-visi t-date').v al()).toEq ual('12/17 /2016'); | |
| 132 | ||
| 133 | expect($vi ew.find('[ for="video -visit-tim e"]').text ()).toEqua l('*\u00a0 Time (EST) '); | |
| 134 | expect($vi ew.find('# video-visi t-time').v al()).toBe ('17:00'); | |
| 135 | ||
| 136 | expect($vi ew.find('[ for="video -visit-dur ation"]'). text()).to Equal('*\u 00a0Durati on'); | |
| 137 | expect($vi ew.find('# video-visi t-duration ').val()). toEqual('2 0'); | |
| 138 | ||
| 139 | // Patient Contact | |
| 140 | expect($vi ew.find('[ for="video -visit-pat ient-email "]').text( )).toEqual ('*\u00a0P atient Ema il'); | |
| 141 | expect($vi ew.find('# video-visi t-patient- email').va l()).toEqu al(''); | |
| 142 | ||
| 143 | expect($vi ew.find('[ for="video -visit-pat ient-phone -type"]'). text()).to Equal('Pho ne Type'); | |
| 144 | expect($vi ew.find('# video-visi t-patient- phone-type ').val()). toEqual('W ork'); | |
| 145 | ||
| 146 | expect($vi ew.find('[ for="video -visit-pat ient-phone "]').text( )).toEqual ('Patient Phone'); | |
| 147 | expect($vi ew.find('# video-visi t-patient- phone').va l()).toEqu al('(234) 567-8905') ; | |
| 148 | ||
| 149 | // Provide r Contact | |
| 150 | expect($vi ew.find('[ for="video -visit-pro vider-firs t-name"]') .text()).t oEqual('*\ u00a0Provi der First Name'); | |
| 151 | expect($vi ew.find('# video-visi t-provider -first-nam e').val()) .toEqual(' '); | |
| 152 | ||
| 153 | expect($vi ew.find('[ for="video -visit-pro vider-last -name"]'). text()).to Equal('*\u 00a0Provid er Last Na me'); | |
| 154 | expect($vi ew.find('# video-visi t-provider -last-name ').val()). toEqual('' ); | |
| 155 | ||
| 156 | expect($vi ew.find('[ for="video -visit-pro vider-emai l"]').text ()).toEqua l('*\u00a0 Provider E mail'); | |
| 157 | expect($vi ew.find('# video-visi t-provider -email').v al()).toEq ual(''); | |
| 158 | ||
| 159 | expect($vi ew.find('[ for="video -visit-pro vider-phon e"]').text ()).toEqua l('*\u00a0 Provider P hone'); | |
| 160 | expect($vi ew.find('# video-visi t-provider -phone').v al()).toEq ual(''); | |
| 161 | ||
| 162 | // Comment s, Instruc tions | |
| 163 | expect($vi ew.find('l abel[for=" video-visi t-provider -comment"] ').text()) .toEqual(' Comments') ; | |
| 164 | expect($vi ew.find('# video-visi t-provider -comment') .prop('max length')). toBe(250); | |
| 165 | expect($vi ew.find('. textarea-c ounter[for ="video-vi sit-provid er-comment "]').text( )).toEqual ('250 char acters rem aining'); | |
| 166 | expect($vi ew.find('# video-visi t-provider -comment') .val()).to Equal(''); | |
| 167 | }); | |
| 168 | }); | |
| 169 | ||
| 170 | descri be("when f or an Expr ess Care r equest", f unction () { | |
| 171 | beforeAl l(function () { | |
| 172 | Appointmen tRequest.i nstance(). set({ | |
| 173 | un iqueId: '1 234', | |
| 174 | ty peOfCareId : 'CR1', | |
| 175 | ph oneNumber: '12345678 90', | |
| 176 | em ail: 'pati ent@test.c om' | |
| 177 | }); | |
| 178 | ||
| 179 | view = new FormView( { | |
| 180 | mo del: model , | |
| 181 | ap ptsCollect ion: appts Collection , | |
| 182 | vi deoVisitFa cilityMode l: videoVi sitFacilit yModel, | |
| 183 | pa tientIdent ifierModel : patientI dentifierM odel, | |
| 184 | de mographics Collection : demograp hicsCollec tion | |
| 185 | }); | |
| 186 | layout.con tentRegion .show(view ); | |
| 187 | $view = vi ew.$el; | |
| 188 | }); | |
| 189 | ||
| 190 | afterAll (function( ) { | |
| 191 | view.close (); | |
| 192 | Appointmen tRequest.i nstance(). clear(); | |
| 193 | }); | |
| 194 | ||
| 195 | it("has the patien t contact' s default values fro m the requ est", func tion() { | |
| 196 | // Patient Contact | |
| 197 | expect($vi ew.find('[ for="video -visit-pat ient-email "]').text( )).toEqual ('*\u00a0P atient Ema il'); | |
| 198 | expect($vi ew.find('# video-visi t-patient- email').va l()).toEqu al('patien t@test.com '); | |
| 199 | ||
| 200 | expect($vi ew.find('[ for="video -visit-pat ient-phone "]').text( )).toEqual ('Patient Phone'); | |
| 201 | expect($vi ew.find('# video-visi t-patient- phone').va l()).toEqu al('(123) 456-7890') ; | |
| 202 | }); | |
| 203 | }); | |
| 204 | ||
| 205 | descri be("when s ubmiting a n Express Care reque st", funct ion () { | |
| 206 | beforeAl l(function () { | |
| 207 | Appointmen tRequest.i nstance(). set({ | |
| 208 | ty peOfCareId : 'CR1', | |
| 209 | ph oneNumber: '12345678 90', | |
| 210 | em ail: 'pati ent@test.c om' | |
| 211 | }); | |
| 212 | spyOn(Form View.proto type, 'val idateAndSa ve').and.c allThrough (); | |
| 213 | spyOn(Form View.proto type, 'res etFormVali dation'); | |
| 214 | spyOn(Form View.proto type, 'sav ePatientCo ntact'); | |
| 215 | spyOn(Glob al.getUtil ities().ev entAggrega tor, 'trig ger'); | |
| 216 | spyOn(Form View.proto type, 'sav eNewVideoV isit').and .callFake( function() { | |
| 217 | re turn { | |
| 218 | done : function (callback) { return callback(" done"); } | |
| 219 | }; | |
| 220 | }); | |
| 221 | view = new FormView( { | |
| 222 | mo del: model , | |
| 223 | ap ptsCollect ion: appts Collection , | |
| 224 | vi deoVisitFa cilityMode l: videoVi sitFacilit yModel, | |
| 225 | pa tientIdent ifierModel : patientI dentifierM odel, | |
| 226 | de mographics Collection : demograp hicsCollec tion | |
| 227 | }); | |
| 228 | layout.con tentRegion .show(view ); | |
| 229 | $view = vi ew.$el; | |
| 230 | }); | |
| 231 | ||
| 232 | afterAll (function( ) { | |
| 233 | view.close (); | |
| 234 | Appointmen tRequest.i nstance(). clear(); | |
| 235 | }); | |
| 236 | ||
| 237 | it("shou ld call va lidateAndS ave", func tion() { | |
| 238 | $view.find ('#create- new-video- visit-btn' ).click(); | |
| 239 | expect(vie w.validate AndSave).t oHaveBeenC alled(); | |
| 240 | expect(vie w.resetFor mValidatio n).toHaveB eenCalled( ); | |
| 241 | expect(vie w.savePati entContact ).toHaveBe enCalled() ; | |
| 242 | expect(vie w.saveNewV ideoVisit) .toHaveBee nCalled(); | |
| 243 | expect(Glo bal.getUti lities().e ventAggreg ator.trigg er).toHave BeenCalled With('disa ble-resolu tion'); | |
| 244 | }); | |
| 245 | }); | |
| 246 | ||
| 247 | // bra nching ini tialize | |
| 248 | ||
| 249 | // dat epicker, t imepicker onShow | |
| 250 | ||
| 251 | // ini tializeFor mValidatio n | |
| 252 | ||
| 253 | // res etFormVali dation | |
| 254 | ||
| 255 | // sho wErrorSect ion | |
| 256 | ||
| 257 | // hid eErrorSect ion | |
| 258 | ||
| 259 | // can celNewVisi tAppt | |
| 260 | ||
| 261 | // val idateAndSa ve | |
| 262 | ||
| 263 | // sav eNewVideoV isit | |
| 264 | ||
| 265 | // sav ePatientCo ntact | |
| 266 | ||
| 267 | // sho wConfirmat ionPpopup | |
| 268 | ||
| 269 | // rou ndTimeToNe xt15 | |
| 270 | ||
| 271 | // upd ate model | |
| 272 | }); | |
| 273 | ||
| 274 | } | |
| 275 | ); |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.