Produced by Araxis Merge on 12/7/2018 11:36:01 AM Central 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 | C:\SCRUB\MHED\MHED\VAR 4.10.0\var-web-release-4.10@e10f18de1ef\veteran-appointment-requests\app\modules\appointments\booked | booked-appointment-view_spec.js | Mon Oct 22 23:25:20 2018 UTC |
| 2 | C:\MHED-scrubbed\MHED\MHED\VAR 4.10.0\var-web-release-4.10@e10f18de1ef\veteran-appointment-requests\app\modules\appointments\booked | booked-appointment-view_spec.js | Fri Dec 7 13:07:12 2018 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 390 |
| 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 | define([ | |
| 2 | 'backb one', | |
| 3 | 'momen t', | |
| 4 | 'Layou t', | |
| 5 | 'modul es/appoint ments/book ed/appoint ment-cance l-reason-s ection-vie w', | |
| 6 | 'modul es/appoint ments/book ed/booked- appointmen t-view', | |
| 7 | 'modul es/appoint ments/book ed/booked- appointmen ts-collect ion', | |
| 8 | ], functio n( | |
| 9 | Backbo ne, | |
| 10 | moment , | |
| 11 | Layout , | |
| 12 | Appoin tmentCance lReasonSec tionView, | |
| 13 | Booked Appointmen tView, | |
| 14 | Booked Appointmen tsCollecti on | |
| 15 | ) { | |
| 16 | 'use s trict'; | |
| 17 | ||
| 18 | descri be('Booked Appointme nt View', function() { | |
| 19 | va r view; | |
| 20 | va r $view; | |
| 21 | va r ccview; | |
| 22 | va r $ccview; | |
| 23 | va r model; | |
| 24 | ||
| 25 | va r layout = new Layou t(); | |
| 26 | ||
| 27 | la yout.rende r(); | |
| 28 | ||
| 29 | be foreEach(f unction() { | |
| 30 | // TODO this model should be imported | |
| 31 | // eslin t-disable- next-line new-cap | |
| 32 | model = new Booked Appointmen tsCollecti on.prototy pe.model({ | |
| 33 | 'app ointmentLe ngth': '30 ', | |
| 34 | 'app ointmentTi me': '06/1 1/2016 09: 00:00', | |
| 35 | 'boo kingNote': 'Reason', | |
| 36 | 'cli nic': { 'n ame': 'ABC Clinic', 'friendlyN ame': 'Fri endlyName' , 'askForC heckIn': f alse}, | |
| 37 | 'cur rentStatus ': 'FUTURE ', | |
| 38 | 'lin k': [ | |
| 39 | { | |
| 40 | 'href': 'h ttp:// IP /VeteranAp pointmentR equestServ ice/rest/d irect-sche duling/sit e/688/pati ent/EDIPI/ 0000000001 /cancel-ap pointment' , | |
| 41 | 'rel': 'related' , | |
| 42 | 'title ': 'cancel -appointme nt', | |
| 43 | }, | |
| 44 | ], | |
| 45 | 'pur pose': 'Me dication C oncern', | |
| 46 | 'typ e': 'REGUL AR', | |
| 47 | 'sit eCode': '2 44', | |
| 48 | 'fac ilityName' : 'FACILIT Y VAMC', | |
| 49 | }); | |
| 50 | ||
| 51 | view = n ew BookedA ppointment View({mode l: model}) ; | |
| 52 | ||
| 53 | layout.s howChildVi ew('conten t', view); | |
| 54 | $view = view.$el; | |
| 55 | ||
| 56 | // TODO: we should n't have t o do this | |
| 57 | view.onA ttach(); | |
| 58 | }) ; | |
| 59 | ||
| 60 | af terEach(fu nction() { | |
| 61 | layout.g etRegion(' content'). empty(); | |
| 62 | }) ; | |
| 63 | ||
| 64 | it ('has a bu tton for t he electro nic calend ar', funct ion() { | |
| 65 | expect($ view.find( '#add-to-c alendar-bt n > span:f irst-child ').text()) .toEqual(' Add to Cal endar'); | |
| 66 | }) ; | |
| 67 | ||
| 68 | it ('has a fe edback lin k', functi on () { | |
| 69 | expect($ view.find( '#appointm ent-feedba ck-link > a:first-ch ild').attr ('href')). toBe('#fee dback'); | |
| 70 | expect($ view.find( '#appointm ent-feedba ck-link > a:first-ch ild').text ()).toEqua l('Provide feedback on this su bmission.' ); | |
| 71 | }) ; | |
| 72 | ||
| 73 | de scribe('wh en using a Booked Ap pointment View', fun ction() { | |
| 74 | it('can get the el ectronic c alendar as a string' , function () { | |
| 75 | var appointmen tsIcs; | |
| 76 | ||
| 77 | mode l.set('boo kingNote', 'Reason') ; | |
| 78 | appo intmentsIc s = 'BEGIN :VCALENDAR \n' + | |
| 79 | 'PRODID:-/ /Departmen t of Veter ans Affair s//VAR-WEB v3.0//EN\ n' + | |
| 80 | 'VERSION:2 .0\n' + | |
| 81 | 'BEGIN:VEV ENT\n' + | |
| 82 | 'UID:20160 611T090000 244\n' + | |
| 83 | 'DTSTAMP:' + moment. utc().form at('YYYYMM DDTHHmmss' ) + 'Z\n' + | |
| 84 | 'DTSTART:2 0160611T09 0000\n' + | |
| 85 | 'DTEND:201 60611T0930 00\n' + | |
| 86 | 'LOCATION: \n' + | |
| 87 | 'SUMMARY:F ACILITY VA MC, ABC Cl inic\n' + | |
| 88 | 'DESCRIPTI ON:\n' + | |
| 89 | 'END:VEVEN T\n' + | |
| 90 | 'END:VCALE NDAR'; | |
| 91 | expe ct(view.ge tCalendar( )).toEqual (appointme ntsIcs); | |
| 92 | }); | |
| 93 | }) ; | |
| 94 | ||
| 95 | de scribe('wh en clickin g electron ic calenda r button', function( ) { | |
| 96 | it('shou ld open an ics file' , function () { | |
| 97 | spyO n(window, 'open'); | |
| 98 | $vie w.find('#a dd-to-cale ndar-btn') .click(); | |
| 99 | expe ct(window. open).toHa veBeenCall edWith('da ta:text/ca lendar;cha rset=utf-8 ,' + encod eURICompon ent(view.g etCalendar ())); | |
| 100 | }); | |
| 101 | }) ; | |
| 102 | ||
| 103 | de scribe('wh en the app ointment i s not canc elled', fu nction() { | |
| 104 | it('has a primary content he ader', fun ction() { | |
| 105 | expe ct($view.f ind('.prim ary-header ').find('h 2') | |
| 106 | .text()).t oEqual('Ap pointment Details'); | |
| 107 | }); | |
| 108 | it('show s details date/time, clinic in fo, and ca ncel appoi ntment btn ', functio n() { | |
| 109 | var $clinic; | |
| 110 | var $fieldset = $view.fi nd('#appoi ntment-det ails-secti on .field- set-flex:e q(0)'); | |
| 111 | // C onvert <br > to a spa ce to allo w .text() to treat i t as plain whitespac e | |
| 112 | $cli nic = $fie ldset.find ('.field-c ontain:eq( 1)').clone (); | |
| 113 | $cli nic.find(' br').repla ceWith(' ' ); | |
| 114 | ||
| 115 | expe ct(cleanUp Whitespace ($clinic.t ext())).to Equal('Det ails: Frie ndlyName A BC Clinic Please arr ive 30 min utes befor e your sch eduled tim e unless o therwise d irected. V A Facility Locator') ; | |
| 116 | ||
| 117 | expe ct(cleanUp Whitespace ($fieldset .find('.fi eld-contai n:eq(2)'). text())).t oEqual('Ca ncel Appoi ntment'); | |
| 118 | $fie ldset = $v iew.find(' #appointme nt-details -section . field-set: eq(0)'); | |
| 119 | expe ct(cleanUp Whitespace ($fieldset .find('.fi eld-contai n').text() )).toEqual ('Reason f or Appoint ment: Reas on'); | |
| 120 | }); | |
| 121 | ||
| 122 | it('show s reason f or appoint ment', fun ction() { | |
| 123 | var $fieldset = $view.fi nd('#appoi ntment-det ails-secti on .field- set:eq(0)' ); | |
| 124 | ||
| 125 | expe ct(cleanUp Whitespace ($fieldset .find('.fi eld-contai n:eq(0)'). text())).t oEqual('Re ason for A ppointment : Reason') ; | |
| 126 | }); | |
| 127 | }) ; | |
| 128 | ||
| 129 | de scribe('Wh en communi ty care bo oked appoi ntment exi sts', func tion() { | |
| 130 | beforeEa ch(functio n() { | |
| 131 | var Model = Bo okedAppoin tmentsColl ection.pro totype.mod el; | |
| 132 | mode l = new Mo del({ | |
| 133 | '_id': '2c e', | |
| 134 | '_class': 'BookCCApp ointment', | |
| 135 | 'appointme ntTime': ' 03/01/2018 07:00:00' , | |
| 136 | 'distanceE ligibleCon firmed': t rue, | |
| 137 | 'name': { | |
| 138 | 'first Name': 'be nben2', | |
| 139 | 'lastN ame': 'wer ner', | |
| 140 | }, | |
| 141 | 'providerP ractice': 'schulhous e', | |
| 142 | 'providerP hone': '(2 34) 567-89 00', | |
| 143 | 'address': { | |
| 144 | 'stree t': '345 D eer Park S t', | |
| 145 | 'city' : 'Chantil ly', | |
| 146 | 'state ': 'VA', | |
| 147 | 'zipCo de': '2315 0', | |
| 148 | }, | |
| 149 | 'instructi onsToVeter an': 'Zulf i is in ch arge', | |
| 150 | 'timeZone' : '-05:00 EST', | |
| 151 | }, { parse: tru e}); | |
| 152 | layo ut.getRegi on('conten t').empty( ); | |
| 153 | ccvi ew = new B ookedAppoi ntmentView ({model: m odel}); | |
| 154 | layo ut.showChi ldView('co ntent', cc view); | |
| 155 | $ccv iew = ccvi ew.$el; | |
| 156 | }); | |
| 157 | ||
| 158 | it('show s booked c ommunity c are detail s.', funct ion() { | |
| 159 | var $fieldset = $ccview. find('#app ointment-d etails-sec tion .fiel d-set-flex :eq(0)'); | |
| 160 | // n ew line wa s stripped from text | |
| 161 | expe ct(cleanUp Whitespace ($fieldset .find('.fi eld-contai n-block:eq (0)').text ())).toEqu al('Date a nd Time: T hursday, 0 3/01/20180 700 EST Ad d to Calen dar'); | |
| 162 | expe ct(cleanUp Whitespace ($fieldset .find('.fi eld-contai n-block:eq (1)').text ())) | |
| 163 | .toEqual(' Details: C ommunity A ppointment schulhous e benben2 werner 345 Deer Park St Chanti lly, VA 23 150 (234) 567-8900') ; | |
| 164 | // n ew line wa s stripped from text | |
| 165 | expe ct(cleanUp Whitespace ($fieldset .find('.fi eld-contai n-block:eq (2)').text ())) | |
| 166 | .toEqual(' Need to ca ncel or up date this appointmen t?Please c ontact the provider directly') ; | |
| 167 | }); | |
| 168 | ||
| 169 | it('can get the el ectronic c alendar as a string' , function () { | |
| 170 | var appointmen tsIcs; | |
| 171 | ||
| 172 | mode l.set('boo kingNote', 'Reason') ; | |
| 173 | appo intmentsIc s = 'BEGIN :VCALENDAR \n' + | |
| 174 | 'PRODID:-/ /Departmen t of Veter ans Affair s//VAR-WEB v3.0//EN\ n' + | |
| 175 | 'VERSION:2 .0\n' + | |
| 176 | 'BEGIN:VEV ENT\n' + | |
| 177 | 'UID:20180 301T070000 schulhouse \n' + | |
| 178 | 'DTSTAMP:' + moment. utc().form at('YYYYMM DDTHHmmss' ) + 'Z\n' + | |
| 179 | 'DTSTART:2 0180301T07 0000\n' + | |
| 180 | 'DTEND:201 80301T0700 00\n' + | |
| 181 | 'LOCATION: 345 Deer P ark St \\n Chantilly VA 23150\n ' + | |
| 182 | 'SUMMARY:s chulhouse\ n' + | |
| 183 | 'DESCRIPTI ON:Zulfi i s in charg e\n' + | |
| 184 | 'END:VEVEN T\n' + | |
| 185 | 'END:VCALE NDAR'; | |
| 186 | expe ct(ccview. getCalenda r()).toEqu al(appoint mentsIcs); | |
| 187 | }); | |
| 188 | }) ; | |
| 189 | }); | |
| 190 | ||
| 191 | functi on cleanUp Whitespace (text) { | |
| 192 | va r whitespa ceRegex = /\s+/g; | |
| 193 | va r cleanedT ext = text .replace(w hitespaceR egex, ' ') .trim(); | |
| 194 | re turn clean edText; | |
| 195 | } | |
| 196 | }); |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.