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\new-appointment-request\tests\common\views | type-of-care-layout-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\new-appointment-request\tests\common\views | type-of-care-layout-view-spec.js | Thu May 30 00:01:20 2019 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 558 |
| 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 | 'under score', | |
| 3 | 'backb one', | |
| 4 | 'app-r esources', | |
| 5 | 'modul es/appoint ments/appo intments-m odule', | |
| 6 | 'modul es/new-app ointment-r equest/vie ws/common/ type-of-ca re/layout- view', | |
| 7 | 'modul es/new-app ointment-r equest/tes ts/helpers /facility- helper', | |
| 8 | ], functio n(_, Backb one, resou rces, modu le, View, helpers) { | |
| 9 | 'use s trict'; | |
| 10 | ||
| 11 | ||
| 12 | functi on resourc eSpy() { | |
| 13 | sp yOn(resour ces, 'get' ).and.call Fake(funct ion() { | |
| 14 | return { formatHref : _.noop}; | |
| 15 | }) ; | |
| 16 | re turn resou rces.get; | |
| 17 | } | |
| 18 | ||
| 19 | ||
| 20 | functi on fetchSp y(data) { | |
| 21 | sp yOn(Backbo ne.Collect ion.protot ype, 'fetc h').and.ca llFake(fun ction() { | |
| 22 | var defe rred = new $.Deferre d(); | |
| 23 | this.set (data, {pa rse: true} ); | |
| 24 | deferred .resolve(t his); | |
| 25 | return d eferred; | |
| 26 | }) ; | |
| 27 | re turn modul e.fetchCol lection; | |
| 28 | } | |
| 29 | ||
| 30 | ||
| 31 | functi on mockDat a() { | |
| 32 | re turn [ | |
| 33 | { | |
| 34 | 'id' : '203', | |
| 35 | 'nam e': 'Audio logy', | |
| 36 | 'obj ectType': 'TypesOfCa re', | |
| 37 | 'lin k': [], | |
| 38 | }, | |
| 39 | { | |
| 40 | 'id' : '323', | |
| 41 | 'nam e': 'Prima ry Care', | |
| 42 | 'obj ectType': 'TypesOfCa re', | |
| 43 | 'lin k': [], | |
| 44 | }, | |
| 45 | { | |
| 46 | 'id' : '408', | |
| 47 | 'nam e': 'Optom etry', | |
| 48 | 'obj ectType': 'TypesOfCa re', | |
| 49 | 'lin k': [], | |
| 50 | }, | |
| 51 | { | |
| 52 | 'id' : '502', | |
| 53 | 'nam e': 'Outpa tient Ment al Health' , | |
| 54 | 'obj ectType': 'TypesOfCa re', | |
| 55 | 'lin k': [], | |
| 56 | }, | |
| 57 | { | |
| 58 | 'id' : 'CR1', | |
| 59 | 'nam e': 'Expre ss Care', | |
| 60 | 'obj ectType': 'TypesOfCa re', | |
| 61 | 'lin k': [], | |
| 62 | }, | |
| 63 | ]; | |
| 64 | } | |
| 65 | ||
| 66 | ||
| 67 | descri be('Step 1 Type of C are', func tion() { | |
| 68 | ||
| 69 | ||
| 70 | /* * | |
| 71 | * https:// DNS . URL /browse/VA R-9195 | |
| 72 | * | |
| 73 | * As a user | |
| 74 | * I want to be able t o select t he specifi c location where I w ant to rec eive care | |
| 75 | * So that m y booking process is streamlin ed focuses on a smal ler number of specif ic clinics | |
| 76 | * | |
| 77 | * When a us er views t he New App ointment/R equest for m, the “ro uting ques tions” sho wn at the top part o f the form | |
| 78 | * are revis ed to acco mmodate lo cation lev el booking as follow s | |
| 79 | * / | |
| 80 | de scribe('VA R-9195 Spe cification ', functio n() { | |
| 81 | ||
| 82 | ||
| 83 | /** | |
| 84 | * 1. When the user view s the page body, the following informati on is show n: | |
| 85 | * | |
| 86 | * 1.1. A left m argin is s hown on th e body of the page w ith the la bel: Step 1: Type of Care show n | |
| 87 | * | |
| 88 | * 1.2. To the r ight of th e Step 1 l abel, inst ructional text and t he type of care fiel d are show n: | |
| 89 | * | |
| 90 | * 1.2.1 Text: Th e VA Appoi ntment App supports scheduling specific types of c are: | |
| 91 | * | |
| 92 | * 1.2.2 Label: S elect the type of ca re you nee d: (requir ed) | |
| 93 | * | |
| 94 | * 1.2.3 Drop dow n list box displays all types of care av ailable at the enter prise leve l (utility | |
| 95 | * configur ation is n ot applied to filter this list ); | |
| 96 | * | |
| 97 | * 1.2.4 Primary care is sh own as the first sel ection in the list, all other list items are shown below | |
| 98 | * primary care in al phabetical order | |
| 99 | */ | |
| 100 | describe ('1.0.0 - 1.2.4', fu nction() { | |
| 101 | var view; | |
| 102 | var gas; | |
| 103 | ||
| 104 | ||
| 105 | befo reEach(fun ction() { | |
| 106 | var region = helpers .setupTest ingRegion( ); | |
| 107 | resourceSp y(); | |
| 108 | fetchSpy(m ockData()) ; | |
| 109 | ||
| 110 | region.sho w(new View ({ | |
| 111 | model: new Backb one.Model( ), | |
| 112 | google AnalyticsP rovider: { | |
| 113 | ge tInstance: function( ) { | |
| 114 | gas = ja smine.crea teSpyObj(' gas', ['ga s']); | |
| 115 | return g as; | |
| 116 | }, | |
| 117 | }, | |
| 118 | ccElig ible: true , | |
| 119 | })); | |
| 120 | ||
| 121 | view = reg ion.curren tView; | |
| 122 | ||
| 123 | }); | |
| 124 | ||
| 125 | afte rEach(help ers.setupT estingRegi on); | |
| 126 | ||
| 127 | it(' show the c orrect mar gin', func tion() { | |
| 128 | var legend = view.$( '.form-sec tion-headi ng').text( ) | |
| 129 | .trim( ); | |
| 130 | var arr = legend.spl it('\n'); | |
| 131 | var text; | |
| 132 | ||
| 133 | arr = _.ma p(arr, fun ction(item ) { | |
| 134 | return item.trim (); | |
| 135 | }); | |
| 136 | text = arr .join(' ') ; | |
| 137 | ||
| 138 | expect(tex t).toBe('S tep 1: Typ e of Care' ); | |
| 139 | }); | |
| 140 | ||
| 141 | it(' creates a dropdown f ull of typ e of care items', fu nction() { | |
| 142 | var option s = view.$ ('#typeOfC are').chil dren(); | |
| 143 | ||
| 144 | // collect ion.length + 1 becau se of the placeholde r | |
| 145 | expect(opt ions.lengt h).toBe(vi ew.collect ion.length + 1); | |
| 146 | }); | |
| 147 | ||
| 148 | it(' always put s primary care the t op of the list', fun ction() { | |
| 149 | var option s = view.$ ('#typeOfC are').chil dren(); | |
| 150 | var first = options[ 1]; | |
| 151 | var text = first.inn erText.tri m(); | |
| 152 | ||
| 153 | expect(tex t).toBe('P rimary Car e'); | |
| 154 | }); | |
| 155 | ||
| 156 | it(' uses alpha betical or der after primary ca re', funct ion() { | |
| 157 | var option s = view.$ ('#typeOfC are').chil dren(); | |
| 158 | var arr = _.map(opti ons, funct ion(node) { | |
| 159 | return node.inne rText.trim (); | |
| 160 | }); | |
| 161 | ||
| 162 | var afterP rimary = a rr.slice(2 ); | |
| 163 | var last = afterPrim ary.shift( ); | |
| 164 | var isG00d = true; | |
| 165 | var next; | |
| 166 | ||
| 167 | while (aft erPrimary. length) { | |
| 168 | next = afterPrim ary.shift( ); | |
| 169 | if (ne xt.localeC ompare(las t) < 1) { | |
| 170 | is G00d = fal se; | |
| 171 | br eak; | |
| 172 | } | |
| 173 | last = next; | |
| 174 | } | |
| 175 | ||
| 176 | expect(isG 00d).toBeT ruthy(); | |
| 177 | }); | |
| 178 | }); | |
| 179 | }) ; | |
| 180 | ||
| 181 | de scribe('Wh en ADR is enabled', function() { | |
| 182 | var view ; | |
| 183 | var gas; | |
| 184 | var inst ructions; | |
| 185 | var regi on; | |
| 186 | it('will display t he cc supp ort text t hat shows when user is not cc eligible', function( ) { | |
| 187 | regi on = helpe rs.setupTe stingRegio n(); | |
| 188 | reso urceSpy(); | |
| 189 | fetc hSpy(mockD ata()); | |
| 190 | ||
| 191 | regi on.show(ne w View({ | |
| 192 | model: new Backbone. Model(), | |
| 193 | googleAnal yticsProvi der: { | |
| 194 | getIns tance: fun ction() { | |
| 195 | ga s = jasmin e.createSp yObj('gas' , ['gas']) ; | |
| 196 | re turn gas; | |
| 197 | }, | |
| 198 | }, | |
| 199 | isVceEligi ble: true, | |
| 200 | })); | |
| 201 | ||
| 202 | view = region. currentVie w; | |
| 203 | inst ructions = view.$('. step-instr uctions'). text() | |
| 204 | .trim(); | |
| 205 | expe ct(instruc tions).toB e('The VA Appointmen ts app sup ports sche duling spe cific type s of care. If you do n’t see th e type of care you n eed, or if you are s eeking a C ommunity C are appoin tment, ple ase contac t your loc al VA Medi cal Center for assis tance.'); | |
| 206 | }); | |
| 207 | ||
| 208 | it('will display n on cc supp ort text t hat shows when user is cc elig ible', fun ction() { | |
| 209 | regi on = helpe rs.setupTe stingRegio n(); | |
| 210 | reso urceSpy(); | |
| 211 | fetc hSpy(mockD ata()); | |
| 212 | ||
| 213 | regi on.show(ne w View({ | |
| 214 | model: new Backbone. Model(), | |
| 215 | googleAnal yticsProvi der: { | |
| 216 | getIns tance: fun ction() { | |
| 217 | ga s = jasmin e.createSp yObj('gas' , ['gas']) ; | |
| 218 | re turn gas; | |
| 219 | }, | |
| 220 | }, | |
| 221 | isVceEligi ble: false , | |
| 222 | })); | |
| 223 | ||
| 224 | view = region. currentVie w; | |
| 225 | inst ructions = view.$('. step-instr uctions'). text() | |
| 226 | .trim(); | |
| 227 | expe ct(instruc tions).toB e('The VA Appointmen ts app sup ports sche duling spe cific type s of care. If you do not find the care y ou need, p lease cont act your f acility fo r assistan ce.'); | |
| 228 | }); | |
| 229 | }) ; | |
| 230 | ||
| 231 | de scribe('Co mpleting C overage', function() { | |
| 232 | var view ; | |
| 233 | var data ; | |
| 234 | var gas; | |
| 235 | ||
| 236 | beforeEa ch(functio n() { | |
| 237 | var region = h elpers.set upTestingR egion(); | |
| 238 | var id; | |
| 239 | ||
| 240 | reso urceSpy(); | |
| 241 | data = mockDat a(); | |
| 242 | fetc hSpy(data) ; | |
| 243 | id = data[0].i d; | |
| 244 | ||
| 245 | regi on.show(ne w View({ | |
| 246 | model: new Backbone. Model({typ eOfCare: i d}), | |
| 247 | googleAnal yticsProvi der: { | |
| 248 | getIns tance: fun ction() { | |
| 249 | ga s = jasmin e.createSp yObj('gas' , ['gas']) ; | |
| 250 | re turn gas; | |
| 251 | }, | |
| 252 | }, | |
| 253 | ccEligible : true, | |
| 254 | })); | |
| 255 | ||
| 256 | view = region. currentVie w; | |
| 257 | ||
| 258 | }); | |
| 259 | ||
| 260 | it('gets the corre ct name fo r the sele cted type of care', function() { | |
| 261 | var expected = data[0].n ame; | |
| 262 | var actually = view.getC areName(); | |
| 263 | ||
| 264 | expe ct(actuall y).toBe(ex pected); | |
| 265 | }); | |
| 266 | ||
| 267 | it('getC areName ca n handle t he case th at type is not selec ted', func tion() { | |
| 268 | view .model.set ('typeOfCa re', 'Does Not Exits '); | |
| 269 | ||
| 270 | expe ct(view.ge tCareName( )).toBe('' ); | |
| 271 | }); | |
| 272 | ||
| 273 | it('shou ld call Go ogle Analy tics when the type o f care is changed', function() { | |
| 274 | view .model.set ('typeOfCa re', 'Audi ology'); | |
| 275 | ||
| 276 | expe ct(gas.gas .calls.fir st().args) .toEqual([ 'send', 'e vent', 've teran-appo intment', 'type-of-c are-select ed', 'Audi ology']); | |
| 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.