Produced by Araxis Merge on 5/10/2018 8:40:52 AM 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 | MHED_APPS_CIF.zip\VAR v4.2.7\var-web-4.2.7@0810ae549c1.zip\veteran-appointment-requests\app\modules\appointments\booked | booked-appointment-view_spec.js | Mon Apr 9 06:06:53 2018 UTC |
2 | MHED_APPS_CIF.zip\VAR v4.2.7\var-web-4.2.7@0810ae549c1.zip\veteran-appointment-requests\app\modules\appointments\booked | booked-appointment-view_spec.js | Thu May 3 13:35:07 2018 UTC |
Description | Between Files 1 and 2 |
|
---|---|---|
Text Blocks | Lines | |
Unchanged | 2 | 362 |
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 | spyOn(Bo okedAppoin tmentView. prototype, 'fetchCli nicProfile ').and.cal lFake(func tion() { | |
31 | var resolved = new $.Def erred(); | |
32 | reso lved.resol ve({ | |
33 | appointmen tLength: ' 30', | |
34 | clinicId: '19', | |
35 | clinicName : 'ABC Cli nic', | |
36 | siteCode: '244', | |
37 | stopCode: '172', | |
38 | }); | |
39 | retu rn resolve d; | |
40 | }); | |
41 | spyOn(Bo okedAppoin tmentView. prototype, 'showCanc elReasonVi ew'); | |
42 | spyOn(Bo okedAppoin tmentView. prototype, 'showCanc ellationVi ew'); | |
43 | ||
44 | // TODO this model should be imported | |
45 | // eslin t-disable- next-line new-cap | |
46 | model = new Booked Appointmen tsCollecti on.prototy pe.model({ | |
47 | 'app ointmentLe ngth': '30 ', | |
48 | 'app ointmentTi me': '06/1 1/2016 09: 00:00', | |
49 | 'boo kingNote': 'Reason', | |
50 | 'cli nic': { 'n ame': 'ABC Clinic', 'friendlyN ame': 'Fri endlyName' , 'askForC heckIn': f alse}, | |
51 | 'cur rentStatus ': 'FUTURE ', | |
52 | 'lin k': [ | |
53 | { | |
54 | 'href': 'h ttp:// IP /VeteranAp pointmentR equestServ ice/rest/d irect-sche duling/sit e/688/pati ent/EDIPI/ 0000000001 /cancel-ap pointment' , | |
55 | 'rel': 'related' , | |
56 | 'title ': 'cancel -appointme nt', | |
57 | }, | |
58 | ], | |
59 | 'pur pose': 'Me dication C oncern', | |
60 | 'typ e': 'REGUL AR', | |
61 | 'sit eCode': '2 44', | |
62 | 'fac ilityName' : 'FACILIT Y VAMC', | |
63 | }); | |
64 | ||
65 | view = n ew BookedA ppointment View({mode l: model}) ; | |
66 | ||
67 | layout.c ontent.sho w(view); | |
68 | $view = view.$el; | |
69 | }) ; | |
70 | ||
71 | af terEach(fu nction() { | |
72 | layout.c ontent.emp ty(); | |
73 | }) ; | |
74 | ||
75 | it ('has a bu tton for t he electro nic calend ar', funct ion() { | |
76 | expect($ view.find( '#add-to-c alendar-bt n > span:f irst-child ').text()) .toEqual(' Add to Cal endar'); | |
77 | }) ; | |
78 | ||
79 | de scribe('wh en using a Booked Ap pointment View', fun ction() { | |
80 | it('can get the el ectronic c alendar as a string' , function () { | |
81 | var appointmen tsIcs; | |
82 | ||
83 | mode l.set('boo kingNote', 'Reason') ; | |
84 | appo intmentsIc s = 'BEGIN :VCALENDAR \n' + | |
85 | 'PRODID:-/ /Departmen t of Veter ans Affair s//VAR-WEB v3.0//EN\ n' + | |
86 | 'VERSION:2 .0\n' + | |
87 | 'BEGIN:VEV ENT\n' + | |
88 | 'UID:20160 611T090000 244\n' + | |
89 | 'DTSTAMP:' + moment. utc().form at('YYYYMM DDTHHmmss' ) + 'Z\n' + | |
90 | 'DTSTART:2 0160611T09 0000\n' + | |
91 | 'DTEND:201 60611T0930 00\n' + | |
92 | 'SUMMARY:F ACILITY VA MC, ABC Cl inic\n' + | |
93 | 'END:VEVEN T\n' + | |
94 | 'END:VCALE NDAR'; | |
95 | expe ct(view.ge tCalendar( )).toEqual (appointme ntsIcs); | |
96 | }); | |
97 | }) ; | |
98 | ||
99 | de scribe('wh en clickin g electron ic calenda r button', function( ) { | |
100 | it('shou ld open an ics file' , function () { | |
101 | spyO n(window, 'open'); | |
102 | $vie w.find('#a dd-to-cale ndar-btn') .click(); | |
103 | expe ct(window. open).toHa veBeenCall edWith('da ta:text/ca lendar;cha rset=utf-8 ,' + encod eURICompon ent(view.g etCalendar ())); | |
104 | }); | |
105 | }) ; | |
106 | ||
107 | de scribe('wh en the app ointment i s not canc elled', fu nction() { | |
108 | it('has a primary content he ader', fun ction() { | |
109 | expe ct($view.f ind('.prim ary-header ').find('h 2') | |
110 | .text()).t oEqual('Ap pointment Details'); | |
111 | }); | |
112 | it('show s details' , function () { | |
113 | var $clinic; | |
114 | var $fieldset = $view.fi nd('#appoi ntment-det ails-secti on .field- set:eq(0)' ); | |
115 | expe ct(cleanUp Whitespace ($fieldset .find('.fi eld-contai n:eq(0)'). text())) | |
116 | .toEqual(' Appointmen t Date/Tim e: 06/11/2 016 @ 09:0 0'); | |
117 | ||
118 | // C onvert <br > to a spa ce to allo w .text() to treat i t as plain whitespac e | |
119 | $cli nic = $fie ldset.find ('.field-c ontain:eq( 1)').clone (); | |
120 | $cli nic.find(' br').repla ceWith(' ' ); | |
121 | ||
122 | expe ct(cleanUp Whitespace ($clinic.t ext())).to Equal('Loc ation/Clin ic: Friend lyName ABC Clinic'); | |
123 | ||
124 | $fie ldset = $v iew.find(' #appointme nt-details -section . field-set: eq(1)'); | |
125 | expe ct(cleanUp Whitespace ($fieldset .find('.fi eld-contai n').text() )).toEqual ('Reason f or Visit: Reason'); | |
126 | }); | |
127 | ||
128 | it('show s a cancel lation vie w', functi on() { | |
129 | expe ct(view.fe tchClinicP rofile).to HaveBeenCa lled(); | |
130 | expe ct(view.sh owCancelRe asonView). toHaveBeen Called(); | |
131 | expe ct(view.sh owCancella tionView). toHaveBeen Called(); | |
132 | // c ancellatio n view is tested in cancellati on-control -view_spec | |
133 | }); | |
134 | }) ; | |
135 | ||
136 | ||
137 | de scribe('Wh en communi ty care bo oked appoi ntment exi sts', func tion() { | |
138 | beforeEa ch(functio n() { | |
139 | var Model = Bo okedAppoin tmentsColl ection.pro totype.mod el; | |
140 | mode l = new Mo del({ | |
141 | '_id': '2c e', | |
142 | '_class': 'BookCCApp ointment', | |
143 | 'appointme ntTime': ' 03/11/2018 07:00:00' , | |
144 | 'distanceE ligibleCon firmed': t rue, | |
145 | 'name': { | |
146 | 'first Name': 'be nben2', | |
147 | 'lastN ame': 'wer ner', | |
148 | }, | |
149 | 'providerP ractice': 'schulhous e', | |
150 | 'providerP hone': '(2 34) 567-89 00', | |
151 | 'address': { | |
152 | 'stree t': '345 D eer Park S t', | |
153 | 'cityF ield': 'Ch antilly', | |
154 | 'state Field': 'V A', | |
155 | 'zipCo de': '2315 0', | |
156 | }, | |
157 | 'instructi onsToVeter an': 'Zulf i is in ch arge', | |
158 | 'timeZone' : '-05:00 EST', | |
159 | }); | |
160 | layo ut.content .empty(); | |
161 | ccvi ew = new B ookedAppoi ntmentView ({model: m odel}); | |
162 | layo ut.content .show(ccvi ew); | |
163 | $ccv iew = ccvi ew.$el; | |
164 | }); | |
165 | ||
166 | it('show s booked c ommunity c are detail s.', funct ion() { | |
167 | var $fieldset = $ccview. find('#app ointment-d etails-sec tion .fiel d-set:eq(0 )'); | |
168 | expe ct(cleanUp Whitespace ($fieldset .find('.fi eld-contai n:eq(0)'). text())).t oEqual('CC '); | |
169 | expe ct(cleanUp Whitespace ($fieldset .find('.fi eld-contai n:eq(1)'). text())) | |
170 | .toEqual(' Appointmen t Date/Tim e: 03/11/2 018 @ 07:0 0'); | |
171 | expe ct(cleanUp Whitespace ($fieldset .find('.fi eld-contai n:eq(2)'). text())) | |
172 | .toEqual(' Location: benben2 we rner schul house 345 Deer Park St , 23150 (234) 567 -8900'); | |
173 | }); | |
174 | }) ; | |
175 | }); | |
176 | ||
177 | functi on cleanUp Whitespace (text) { | |
178 | va r whitespa ceRegex = /\s+/g; | |
179 | va r cleanedT ext = text .replace(w hitespaceR egex, ' ') .trim(); | |
180 | re turn clean edText; | |
181 | } | |
182 | }); |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.