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