Produced by Araxis Merge on 7/25/2018 3:40:53 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 | Pain_Coach_v3.0_Jun_2018.zip\vpc-patient-web.zip\vpc-patient-web\app\common\js\test | veteran-authenticated.js | Fri Jun 1 14:27:13 2018 UTC |
2 | Pain_Coach_v3.0_Jun_2018.zip\vpc-patient-web.zip\vpc-patient-web\app\common\js\test | veteran-authenticated.js | Tue Jul 24 19:09:41 2018 UTC |
Description | Between Files 1 and 2 |
|
---|---|---|
Text Blocks | Lines | |
Unchanged | 2 | 2066 |
Changed | 2 | 4 |
Inserted | 0 | 0 |
Removed | 1 | 1 |
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 | App_Resour ces.hostna me = "http :// URL /"; | ||
2 | (function () { | ||
3 | var re ady = 0; | ||
4 | var re adyCheck = function () { | ||
5 | if (ready == = 3) { | ||
6 | App.vent .trigger(' test_resou rces:loade d'); | ||
7 | } | ||
8 | }; | ||
9 | var su ccessMustS tart = fun ction() { | ||
10 | VP C.Resource s.App = ne w App_Reso urces.Coll ection.App Resources( ); | ||
11 | VP C.Resource s.App.fetc h({ | ||
12 | success: function( ) { | ||
13 | VPC. Resources. HAResource s = new VP C.Collecti on.HAResou rces(); | ||
14 | VPC. Resources. VPCResourc es = new V PC.Collect ion.VPCRes ources(); | ||
15 | VPC. Resources. HAResource s.fetch({s uccess: su ccessHandl er}); | ||
16 | VPC. Resources. VPCResourc es.fetch({ success: s uccessHand ler}); | ||
17 | succ essHandler (); | ||
18 | }}); | ||
19 | }; | ||
20 | |||
21 | var su ccessHandl er = funct ion (colle ction, res ponse, opt ions) { | ||
22 | re ady++; | ||
23 | re adyCheck() ; | ||
24 | }; | ||
25 | succes sMustStart (); | ||
26 | })(); | ||
27 | |||
28 | describe(" Authentica ted test;" , function () { | ||
29 | var ro uter; | ||
30 | var re sourcesLoa ded = fals e; | ||
31 | |||
32 | before Each(funct ion (done) { | ||
33 | if (resource sLoaded) { done(); } | ||
34 | Ap p.vent.on( 'test_reso urces:load ed', funct ion () { | ||
35 | resource sLoaded = true; | ||
36 | done(); | ||
37 | }) ; | ||
38 | }); | ||
39 | |||
40 | descri be("Resour ces", func tion () { | ||
41 | ja smine.DEFA ULT_TIMEOU T_INTERVAL = 300000; | ||
42 | it ('Resource s Should b e loaded.' , function () { | ||
43 | expect(r esourcesLo aded).toBe (true); | ||
44 | }) ; | ||
45 | }); | ||
46 | |||
47 | descri be('HAReso urce shoul d be set', function( ) { | ||
48 | it ('Check HA Resource', function( ) { | ||
49 | expect(VP C.Resource s.HAResour ces).toBeD efined(); | ||
50 | expect(VP C.Resource s.HAResour ces).toHav eData(); | ||
51 | expect(VP C.Resource s.HAResour ces.get("p ublic-user -session") .toJSON(). href); | ||
52 | }) ; | ||
53 | }); | ||
54 | xdescr ibe("Eula Not Accept ed", funct ion () { | ||
55 | be foreEach(f unction (d one) { | ||
56 | App_Util s.DeleteLo calStorage ('VPC_Eula '); | ||
57 | done(); | ||
58 | }) ; | ||
59 | it ('Eula sho uld not ex ist', func tion () { | ||
60 | expect(A pp_Utils.G etLocalSto rage('VPC_ Eula')).to Be(null); | ||
61 | }) ; | ||
62 | }); | ||
63 | xdescr ibe("Eula Accepted", function () { | ||
64 | be foreEach(f unction (d one) { | ||
65 | App.vent .on('eula: accepted', done()); | ||
66 | |||
67 | VPC.Layo ut.modal.s how(VPC.Vi ew.Eula = new VPC.Vi ew.eula()) ; | ||
68 | VPC.View .Eula.show (); | ||
69 | VPC.View .Eula.acce pt(); | ||
70 | }) ; | ||
71 | it ('Eula sho uld be set ', functio n () { | ||
72 | expect(A pp_Utils.G etLocalSto rage('VPC_ Eula')).no t.toEqual( undefined) ; | ||
73 | }) ; | ||
74 | }); | ||
75 | |||
76 | descri be("Eula A ccepted - with histo ry.start() ", functio n () { | ||
77 | // jasmine.DE FAULT_TIME OUT_INTERV AL = 80000 ; | ||
78 | be foreEach(f unction (d one) { | ||
79 | App_Util s.DeleteLo calStorage ('VPC_Eula '); | ||
80 | App.vent .on('eula: shown', fu nction () { | ||
81 | App_ Utils.SetL ocalStorag e('VPC_Eul a', { acce pt_date: n ew Date(). getTime() }); | ||
82 | VPC. View.Eula. hide(); | ||
83 | done (); | ||
84 | }); | ||
85 | App.vent .on('eula: hidden', f unction () { | ||
86 | VPC. Layout.hea der.show(V PC.View.He ader = new VPC.View. header()); | ||
87 | VPC. Layout.foo ter.show(n ew VPC.Vie w.footer() ); | ||
88 | VPC. router = n ew VPC.Rou ter(); | ||
89 | Back bone.histo ry.start() ; | ||
90 | done (); | ||
91 | }); | ||
92 | App.chec kEula(); | ||
93 | }) ; | ||
94 | it ('Eula sho uld be set ', functio n () { | ||
95 | expect(A pp_Utils.G etLocalSto rage('VPC_ Eula')).no t.toEqual( null); | ||
96 | }) ; | ||
97 | }); | ||
98 | |||
99 | xdescr ibe("Fetch User obje ct", funct ion () { | ||
100 | ja smine.DEFA ULT_TIMEOU T_INTERVAL = 120000; | ||
101 | // var user = {}; | ||
102 | va r userLoad ed = false ; | ||
103 | be foreEach(f unction (d one) { | ||
104 | //Set Au thorize Re quest head er | ||
105 | App_Util s.SetReque stHeader() ; | ||
106 | if (user Loaded) { done(); } | ||
107 | App.vent .on('user: loaded', f unction () { | ||
108 | user Loaded = t rue; | ||
109 | //us er = VPC.M odel.User. toJSON(); | ||
110 | done (); | ||
111 | }); | ||
112 | App.vent .on('user: failed', f unction () { done(); }); | ||
113 | //Trigge r event to load user | ||
114 | App.vent .trigger(' load:user' , { init: true }); | ||
115 | }) ; | ||
116 | it ('Users ob ject shoul d contain mhpuser ', function () { | ||
117 | expect(V PC.Data.Vi ew.Header. mhpuser).t oHaveData( ); | ||
118 | }) ; | ||
119 | }); | ||
120 | |||
121 | xdescr ibe("Timeo ut functio nality", f unction () { | ||
122 | de scribe("Ge t Last Acc essed Time ", functio n () { | ||
123 | var latL oaded = fa lse; | ||
124 | beforeEa ch(functio n (done) { | ||
125 | if ( latLoaded) { done(); } | ||
126 | App. vent.on('l astAccesse dTime:succ ess', func tion () { | ||
127 | latLoaded = true; | ||
128 | done(); | ||
129 | }); | ||
130 | App. vent.on('l astAccesse dTime:fail ed', funct ion () { d one(); }); | ||
131 | }); | ||
132 | it('Last Accessed Time fetch should su cceed', fu nction () { | ||
133 | expe ct(latLoad ed).toBe(t rue); | ||
134 | }); | ||
135 | }) ; | ||
136 | de scribe("Mo dal should be presen t if 180 s econds rem ain", func tion () { | ||
137 | var moda lLoaded = false; | ||
138 | beforeEa ch(functio n (done) { | ||
139 | if ( modalLoade d) { done( ); } | ||
140 | App. vent.on('k eepAlive:s tarted', f unction () { | ||
141 | App.KeepAl iveCount = 0; | ||
142 | App.KeepAl iveTimeLef t = 150; | ||
143 | App.vent.o n('timeout Modal:visi ble', func tion () { | ||
144 | modalL oaded = tr ue; | ||
145 | done() ; | ||
146 | }); | ||
147 | }); | ||
148 | App. vent.trigg er('load:u ser', { in it: true } ); | ||
149 | }); | ||
150 | it('Time out Modal should be loaded', f unction () { | ||
151 | expe ct(modalLo aded).toBe (true); | ||
152 | App. KeepAliveC ount = 170 ; | ||
153 | App. KeepAliveT imeLeft = 900; | ||
154 | }); | ||
155 | }) ; | ||
156 | }); | ||
157 | |||
158 | descri be("Router ", functio n() { | ||
159 | |||
160 | bef oreEach(fu nction() { | ||
161 | VPC.route r = new VP C.Router() ; | ||
162 | this.rout eSpy = sin on.spy(); | ||
163 | |||
164 | try { | ||
165 | Backb one.histor y.start({s ilent: tru e, pushSta te: true}) ; | ||
166 | } catch(e ) { } | ||
167 | |||
168 | }); | ||
169 | it ("router s hould be d efined", f unction() { | ||
170 | expect(V PC.router) .toBeDefin ed(); | ||
171 | }) ; | ||
172 | |||
173 | it ("fires ro ute with ' #tools' in the url", function( ) { | ||
174 | VPC.rout er.bind('r oute:tools ', this.ro uteSpy); | ||
175 | VPC.rout er.navigat e('tools', true); | ||
176 | expect(t his.routeS py).toHave BeenCalled Once(); | ||
177 | }) ; | ||
178 | }); | ||
179 | |||
180 | descri be('Help M odal', fun ction() { | ||
181 | va r elDefine d; | ||
182 | be foreEach(f unction (d one) { | ||
183 | $(".menu -list > a: nth-child( 5)").trigg er("click" ); | ||
184 | setTimeo ut(functio n () { | ||
185 | //do mElement = $("#aap-m odal-conte nt"); | ||
186 | elDe fined = ($ ("#help-mo dal > .mod al-content ").length) > 0 ? tru e : false; | ||
187 | done (); | ||
188 | }, 25); | ||
189 | |||
190 | setFixtu res(VPC.La yout.heade r.$el); | ||
191 | }) ; | ||
192 | |||
193 | it ('Modal sh ould be cr eated and displayed on link cl ick event' , function () { | ||
194 | expect(e lDefined). toBeDefine d(); | ||
195 | }) ; | ||
196 | af terEach(fu nction () { | ||
197 | $('#help -modal').m odal('hide '); | ||
198 | }) ; | ||
199 | }); | ||
200 | |||
201 | descri be('help t est', func tion() { | ||
202 | be foreEach(f unction(do ne) { | ||
203 | VPC.Layo ut.header. show(VPC.V iew.Header = new VPC .View.head er()); | ||
204 | $('#help -modal').m odal('show '); | ||
205 | setTimeo ut(done(), 100); | ||
206 | setFixtu res(VPC.La yout.heade r.$el); | ||
207 | }) ; | ||
208 | |||
209 | it ('help mod al loaded' , function () { | ||
210 | expect($ ('#help-mo dal')).toB eInDOM(); | ||
211 | }) ; | ||
212 | it ('Validate feedback url is dis played', f unction() { | ||
213 | expect($(' #general-f eedback a' )[0].inner HTML).toEq ual('https :// ur l
|
||
214 | }) ; | ||
215 | |||
216 | af terEach(fu nction () { | ||
217 | $('#help -modal').m odal('hide '); | ||
218 | }) ; | ||
219 | }); | ||
220 | |||
221 | descri be('Home P age', func tion() { | ||
222 | /* | ||
223 | va r myConten t; | ||
224 | be foreEach(f unction(do ne) { | ||
225 | App.vent .on('home: loaded', d one()); | ||
226 | var myHo me = new V PC.View.ho me(); | ||
227 | |||
228 | myConten t = VPC.La yout.conte nt.show(my Home); | ||
229 | setFixtu res(myCont ent.$el); | ||
230 | }) ; | ||
231 | */ | ||
232 | |||
233 | be foreEach(f unction(do ne) { | ||
234 | VPC.Layo ut.content .show(new VPC.View.h ome); | ||
235 | App.vent .on('home: loaded', d one()); | ||
236 | setFixtu res(VPC.La yout.conte nt.$el); | ||
237 | }) ; | ||
238 | af terEach(fu nction() { | ||
239 | VPC.Layo ut.content .empty(); | ||
240 | }) ; | ||
241 | |||
242 | it ("Home pag e header", function( ) { | ||
243 | expect($ ('#content ').find('h 2').html() ).toEqual( 'Home'); | ||
244 | }) ; | ||
245 | |||
246 | it ("Home pag e welcome message", function() { | ||
247 | expect($ ('.welcome -msg').len gth).toEqu al(1); | ||
248 | expect($ ('.welcome -msg').htm l()).toEqu al("Welcom e to VA Pa in Coach. You will b e able to track your pain and functionin g, use dai ly diaries , and set reminders for yourse lf to chec k-in! You can see yo ur trends and patter ns and use the app's tools to help you m anage your pain."); | ||
249 | }) ; | ||
250 | }); | ||
251 | |||
252 | descri be('Track' , function () { | ||
253 | af terEach(fu nction() { | ||
254 | VPC.Layo ut.content .empty(); | ||
255 | }) ; | ||
256 | de scribe("Tr ack Menu", function( ) { | ||
257 | beforeEa ch(functio n() { | ||
258 | VPC. Layout.con tent.show( new VPC.Vi ew.track); | ||
259 | setF ixtures(VP C.Layout.c ontent.$el ); | ||
260 | }); | ||
261 | |||
262 | it('Conf irm Header text', fu nction() { | ||
263 | expe ct($('#con tent-title ').html()) .toEqual(' Track'); | ||
264 | }); | ||
265 | it('Back button pr esent', fu nction() { | ||
266 | expe ct($('.tit le-back-bt n')).toBeI nDOM(); | ||
267 | }); | ||
268 | it('Veri fy button text', fun ction() { | ||
269 | expe ct($('#btn DailyPain .tablet-te xt').text( )).toEqual ('Track ho w pain is affecting your life and the to ols you us e to manag e the pain .'); | ||
270 | expe ct($('#btn MonthlyChe ckin .tabl et-text'). text()).to Equal('Ans wer these questions once a mon th to eval uate how p ain is aff ecting you r life.'); | ||
271 | }) | ||
272 | }) ; | ||
273 | |||
274 | xd escribe('M onthly Che ck-In', fu nction() { | ||
275 | beforeEa ch(functio n() { | ||
276 | VPC. Layout.con tent.show( new VPC.Vi ew.monthly CheckIn); | ||
277 | setF ixtures(VP C.Layout.c ontent.$el ); | ||
278 | }); | ||
279 | |||
280 | it('Conf irm Header text', fu nction() { | ||
281 | expe ct($('#con tent-title ').html()) .toEqual(' Monthly Ch eck-In'); | ||
282 | }); | ||
283 | it('Back button pr esent', fu nction() { | ||
284 | expe ct($('.tit le-back-bt n')).toBeI nDOM(); | ||
285 | }); | ||
286 | }) ; | ||
287 | de scribe("Mo nthly Chec k-In Confi rm", funct ion() { | ||
288 | var myRe sponse = n ew VPC.Mod el.CheckIn Response({ | ||
289 | pain Intensity: 1, | ||
290 | pain IntensityM ax: 10, | ||
291 | pain Interferen ceGeneral: 2, | ||
292 | pain Interferen ceGeneralM ax: 10, | ||
293 | pain Interferen ceLife: 3, | ||
294 | pain Interferen ceLifeMax: 10, | ||
295 | slee pQuality: 4, | ||
296 | slee pQualityMa x: 10, | ||
297 | plea sureLevel: 2, | ||
298 | plea sureLevelM ax: 3, | ||
299 | depr ession: 2, | ||
300 | depr essionMax: 3, | ||
301 | over allStatus: 3, | ||
302 | over allStatusM ax: 6 | ||
303 | }); | ||
304 | |||
305 | beforeEa ch(functio n() { | ||
306 | VPC. Layout.con tent.show( new VPC.Vi ew.monthly CheckInCon firm({ | ||
307 | model: myR esponse | ||
308 | })); | ||
309 | setF ixtures(VP C.Layout.c ontent.$el ); | ||
310 | }); | ||
311 | |||
312 | it("Veri fy Confirm page load ed", funct ion() { | ||
313 | expe ct($('#con tent-title ').html()) .toEqual(" Monthly Ch eck-In"); | ||
314 | }); | ||
315 | it('Back button pr esent', fu nction() { | ||
316 | expe ct($('.tit le-back-bt n')).toBeI nDOM(); | ||
317 | }); | ||
318 | it("Veri fy Further Assessmen t Page is showing", function() { | ||
319 | expe ct($('#dep ressionAle rt')).toBe InDOM(); | ||
320 | }); | ||
321 | it("VPC- 3530 - ver ify instru ctional te xt", funct ion() { | ||
322 | expe ct($('#tab let-view-m onthly-sco res p')[3] .innerHTML ).toContai n('Here ar e your res ults for t he questio ns that yo u just ans wered.'); | ||
323 | }); | ||
324 | it("VPC- 3529 - ver ify depres sion score displayed on bottom ", functio n() { | ||
325 | expe ct($('.mon thly-score -box h3')[ 8].innerHT ML).toEqua l('Depress ion'); | ||
326 | }); | ||
327 | |||
328 | it('VPC- 3531 - Ver ify score removed fr om labels' , function () { | ||
329 | var scoreLabel s = $('.mo nthly-scor e-box h3') | ||
330 | |||
331 | jQue ry.each(sc oreLabels, function( index, ite m) { | ||
332 | expect(ite m.innerTex t).not.toC ontain('Sc ore'); | ||
333 | }); | ||
334 | }); | ||
335 | }) ; | ||
336 | de scribe("Da ily Pain D iary", fun ction() { | ||
337 | beforeEa ch(functio n() { | ||
338 | VPC. Layout.con tent.show( new VPC.Vi ew.painDia ry); | ||
339 | setF ixtures(VP C.Layout.c ontent.$el ); | ||
340 | }); | ||
341 | afterEac h(function () { | ||
342 | VPC. Layout.con tent.empty (); | ||
343 | }); | ||
344 | it('Conf irm Header text', fu nction() { | ||
345 | expe ct($('#con tent-title ').html()) .toEqual(' Daily Pain Diary'); | ||
346 | }); | ||
347 | it('Back button pr esent', fu nction() { | ||
348 | expe ct($('.tit le-back-bt n')).toBeI nDOM(); | ||
349 | }); | ||
350 | it('Conf irm Pain R ating blan k', functi on() { | ||
351 | expec t($('#pain -rating')) .toHaveVal ue(''); | ||
352 | }); | ||
353 | it('Conf irm mobile panels ex ists', fun ction() { | ||
354 | expe ct($('#acc ordionPain ')).toBeIn DOM(); | ||
355 | }); | ||
356 | it('Conf irm descri ption', fu nction() { | ||
357 | expe ct($('.pai n-diary-se lect-text' )).toBeInD OM(); | ||
358 | }); | ||
359 | |||
360 | describe ('Addition al Treatme nt and Too ls Used', function() { | ||
361 | // o pen tools tab | ||
362 | $('. pain-diary -tabs .nav a[aria-co ntrols="tr eatment-to ols-used"] ').tab('sh ow'); | ||
363 | |||
364 | it(" Look for T ools Used info butto n", functi on() { | ||
365 | expect($(' #info-btn- tools')).t oBeInDOM() ; | ||
366 | }); | ||
367 | |||
368 | it(" Verify Tre atments Us ed are but tons, not checkboxes ", functio n() { | ||
369 | expect($(' #tools-use d-tab #tre atments-us ed input[t ype="check box"]').le ngth).toEq ual(0); | ||
370 | expect($(' #tools-use d-tab #tre atments-us ed button' ).length). toEqual(6) ; | ||
371 | }); | ||
372 | |||
373 | desc ribe("Acti vity Pacin g", functi on() { | ||
374 | beforeEach (function( ) { | ||
375 | $('#bt nToolActiv ity').clic k(); | ||
376 | }); | ||
377 | |||
378 | it('Confir m modal is displayed ', functio n() { | ||
379 | expect ($('#tools -used-moda l')).toBeI nDOM(); | ||
380 | expect ($('#tools -used-head er').html( )).toEqual ('Activity Pacing'); | ||
381 | }); | ||
382 | |||
383 | afterEach( function() { | ||
384 | $('#bt nToolRatin gCancel'). click(); | ||
385 | }); | ||
386 | }); | ||
387 | |||
388 | desc ribe("Deep Breathing ", functio n() { | ||
389 | beforeEach (function( ) { | ||
390 | $('#bt nToolDeep' ).click(); | ||
391 | }); | ||
392 | |||
393 | it('Confir m modal is displayed ', functio n() { | ||
394 | expect ($('#tools -used-moda l')).toBeI nDOM(); | ||
395 | expect ($('#tools -used-head er').html( )).toEqual ('Deep Bre athing'); | ||
396 | }); | ||
397 | |||
398 | afterEach( function() { | ||
399 | $('#bt nToolRatin gCancel'). click(); | ||
400 | }); | ||
401 | }); | ||
402 | |||
403 | desc ribe("Mana ge Thought s", functi on() { | ||
404 | beforeEach (function( ) { | ||
405 | $('#bt nToolManag e').click( ); | ||
406 | }); | ||
407 | |||
408 | it('Confir m modal is displayed ', functio n() { | ||
409 | expect ($('#tools -used-moda l')).toBeI nDOM(); | ||
410 | expect ($('#tools -used-head er').html( )).toEqual ('Manage T houghts'); | ||
411 | }); | ||
412 | |||
413 | afterEach( function() { | ||
414 | $('#bt nToolRatin gCancel'). click(); | ||
415 | }); | ||
416 | }); | ||
417 | |||
418 | desc ribe("Nega tive Thoug hts", func tion() { | ||
419 | beforeEach (function( ) { | ||
420 | VPC.La yout.conte nt.show(ne w VPC.View .negative( )); | ||
421 | setFix tures(VPC. Layout.con tent.$el); | ||
422 | }); | ||
423 | |||
424 | it('Confir m negative thoughts are popula ted', func tion() { | ||
425 | expect ($('#submi t-negative -thought') ).toBeInDO M(); | ||
426 | expect ($('#submi t-negative -thought l i').length ).toEqual( 23); | ||
427 | }) | ||
428 | }); | ||
429 | |||
430 | desc ribe("Musc le Relaxat ion", func tion() { | ||
431 | beforeEach (function( ) { | ||
432 | $('#bt nToolMuscl e').click( ); | ||
433 | }); | ||
434 | |||
435 | it('Confir m modal is displayed ', functio n() { | ||
436 | expect ($('#tools -used-moda l')).toBeI nDOM(); | ||
437 | expect ($('#tools -used-head er').html( )).toEqual ('Muscle R elaxation' ); | ||
438 | }); | ||
439 | |||
440 | afterEach( function() { | ||
441 | $('#bt nToolRatin gCancel'). click(); | ||
442 | }); | ||
443 | }); | ||
444 | |||
445 | desc ribe("Plan a Pleasan t Activity ", functio n() { | ||
446 | beforeEach (function( ) { | ||
447 | $('#bt nToolPlan' ).click(); | ||
448 | }); | ||
449 | |||
450 | it('Confir m modal is displayed ', functio n() { | ||
451 | expect ($('#tools -used-moda l')).toBeI nDOM(); | ||
452 | expect ($('#tools -used-head er').html( )).toEqual ('Plan a P leasant Ac tivity'); | ||
453 | }); | ||
454 | |||
455 | afterEach( function() { | ||
456 | $('#bt nToolRatin gCancel'). click(); | ||
457 | }); | ||
458 | }); | ||
459 | desc ribe("Slee p Tips", f unction() { | ||
460 | beforeEach (function( ) { | ||
461 | $('#bt nToolSleep ').click() ; | ||
462 | }); | ||
463 | |||
464 | it('Confir m modal is displayed ', functio n() { | ||
465 | expect ($('#tools -used-moda l')).toBeI nDOM(); | ||
466 | expect ($('#tools -used-head er').html( )).toEqual ('Sleep Ti ps'); | ||
467 | }); | ||
468 | |||
469 | afterEach( function() { | ||
470 | $('#bt nToolRatin gCancel'). click(); | ||
471 | }); | ||
472 | }); | ||
473 | desc ribe("Visu alization" , function () { | ||
474 | beforeEach (function( ) { | ||
475 | $('#bt nToolVisua l').click( ); | ||
476 | }); | ||
477 | |||
478 | it('Confir m modal is displayed ', functio n() { | ||
479 | expect ($('#tools -used-moda l')).toBeI nDOM(); | ||
480 | expect ($('#tools -used-head er').html( )).toEqual ('Visualiz ation'); | ||
481 | }); | ||
482 | |||
483 | afterEach( function() { | ||
484 | $('#bt nToolRatin gCancel'). click(); | ||
485 | }); | ||
486 | }); | ||
487 | }); | ||
488 | describe ('Health I mpact and Comments', function( ) { | ||
489 | $('. pain-diary -tabs .nav a[aria-co ntrols="he alth-impac t"]').tab( 'show'); | ||
490 | |||
491 | it ( "Check for blank val ue in each selection control", function( ) { | ||
492 | expect($(' #movement- impact')). toHaveValu e(""); | ||
493 | expect($(' #mood-effe ct')).toHa veValue("" ); | ||
494 | expect($(' #sleep-out come')).to HaveValue( ""); | ||
495 | expect($(' #activity- interferen ce')).toHa veValue("" ); | ||
496 | expect($(' #depressio n-level')) .toHaveVal ue(""); | ||
497 | }); | ||
498 | |||
499 | it ( "Check for 0 value i n each sel ection con trol", fun ction() { | ||
500 | expect($(' #movement- impact').v al('0')).t oHaveValue ("0"); | ||
501 | expect($(' #mood-effe ct').val(' 0')).toHav eValue("0" ); | ||
502 | expect($(' #sleep-out come').val ('0')).toH aveValue(" 0"); | ||
503 | expect($(' #activity- interferen ce').val(' 0')).toHav eValue("0" ); | ||
504 | expect($(' #depressio n-level'). val('0')). toHaveValu e("0"); | ||
505 | }); | ||
506 | |||
507 | it ( "VPC-3526 - verify l abel chang es", funct ion() { | ||
508 | var tempLa bel = $('l abel[for=" movement-i mpact"]')[ 0]; | ||
509 | expect(tem pLabel).to BeDefined( ); | ||
510 | expect(tem pLabel.inn erText).to Equal('Enj oyment Int erference' ); | ||
511 | |||
512 | var tempLa bel2 = $(' label[for= "sleep-out come"]')[0 ]; | ||
513 | expect(tem pLabel2).t oBeDefined (); | ||
514 | expect(tem pLabel2.in nerText).t oEqual('Sl eep Qualit y'); | ||
515 | }); | ||
516 | }); | ||
517 | }) ; | ||
518 | }); | ||
519 | |||
520 | xdescr ibe('Pain Diary Conf irm page', function( ) { | ||
521 | be foreEach(f unction(do ne) { | ||
522 | VPC.Layo ut.content .show(new VPC.View.p ainDiaryCo nfirm({ | ||
523 | mode l: new Bac kbone.Mode l({ | ||
524 | currentPai nRating: 5 , | ||
525 | lastPainRa ting: 3 | ||
526 | }) | ||
527 | })); | ||
528 | |||
529 | setTimeo ut(functio n () { | ||
530 | done (); | ||
531 | }, 300); | ||
532 | }) ; | ||
533 | |||
534 | it ('Confirm Header tex t', functi on() { | ||
535 | expect($ ('#content -title').h tml()).toE qual('Dail y Pain Dia ry Confirm ation'); | ||
536 | }) ; | ||
537 | it ('Back but ton presen t', functi on() { | ||
538 | expect($ ('.title-b ack-btn')) .toBeInDOM (); | ||
539 | }) ; | ||
540 | it ('Confirm score is d isplayed', function( ) { | ||
541 | expect($ ('.pain-di ary-score- box')).toC ontainHtml ('<span>5< /span>'); | ||
542 | }) ; | ||
543 | it ('Confirm previous s core is re viewed on screen', f unction() { | ||
544 | expect($ ('.evaluat ion')).toC ontainText ('Your pai n rating h as increas ed by 2 po ints since your last entry.'); | ||
545 | }) ; | ||
546 | |||
547 | }); | ||
548 | |||
549 | descri be("Progre ss", funct ion() { | ||
550 | af terEach(fu nction() { | ||
551 | VPC.Layo ut.content .empty(); | ||
552 | }) ; | ||
553 | |||
554 | xd escribe("P rogress Ma in Menu", function() { | ||
555 | beforeEa ch(functio n() { | ||
556 | VPC. Layout.con tent.show( new VPC.Vi ew.progres s); | ||
557 | setF ixtures(VP C.Layout.c ontent.$el ); | ||
558 | }); | ||
559 | it('Conf irm Header text', fu nction() { | ||
560 | expe ct($('#con tent-title ').html()) .toEqual(' Progress') ; | ||
561 | }); | ||
562 | it('Back button pr esent', fu nction() { | ||
563 | expe ct($('.tit le-back-bt n')).toBeI nDOM(); | ||
564 | }); | ||
565 | }) ; | ||
566 | |||
567 | de scribe('Mo nthly Chec k-In', fun ction () { | ||
568 | describe ('Monthly Check-In G raph', fun ction () { | ||
569 | befo reEach(fun ction (don e) { | ||
570 | var ready = 0; | ||
571 | var readyC heck = fun ction () { | ||
572 | ready+ +; | ||
573 | if (re ady === 2) { // set to 2 | ||
574 | se tTimeout(f unction () { | ||
575 | done(); | ||
576 | }, 250); | ||
577 | } | ||
578 | }; | ||
579 | |||
580 | App.vent.o n("assessm entGraph:r endered", readyCheck ()); | ||
581 | App.vent.o n("monthly CheckInGra ph:rendere d", readyC heck()); | ||
582 | |||
583 | VPC.Layout .content.s how(new VP C.View.ass essmentsGr aphReports ({action: 'graph'})) ; | ||
584 | setFixture s(VPC.Layo ut.content .$el); | ||
585 | }); | ||
586 | |||
587 | it(' Confirm He aders text ', functio n() { | ||
588 | //expect($ ('#content -title').h tml()).toE qual('Mont hly Check- In Graph') ; | ||
589 | //expect($ ('#content ')).toBeIn DOM(); | ||
590 | expect($(' #content') .find('h2' ).find('sp an').html( )).toEqual ('Monthly <br>Check- In Graph') ; | ||
591 | expect($(' #overall-s tatus-pane l').find(' .panel-hea ding').fin d('strong' ).html()). toEqual('O verall Sta tus'); | ||
592 | }); | ||
593 | it(' Back butto n present' , function () { | ||
594 | expect($(' .title-bac k-btn')).t oBeInDOM() ; | ||
595 | }); | ||
596 | |||
597 | it(' Sort butto n present' , function () { | ||
598 | expect($(' #sortBtn') ).toBeInDO M(); | ||
599 | }); | ||
600 | }); | ||
601 | describe ("Monthly Check-in T abular", f unction() { | ||
602 | var myCollecti on = new B ackbone.Co llection() ; | ||
603 | var d = new Da te(); | ||
604 | // p opulate 30 rows into the colle ction | ||
605 | for (var idx = 0; idx < 12; idx++) { | ||
606 | var painDi aryRow = n ew VPC.Mod el.PainDia ry(); | ||
607 | painDiaryR ow.set("da teCreated" , d.toISOS tring()); | ||
608 | painDiaryR ow.set("re portDate", d.toISOSt ring()); | ||
609 | painDiaryR ow.set("sc ore", idx % 10); | ||
610 | painDiaryR ow.set("ma xScore", 1 0); | ||
611 | myCollecti on.push(pa inDiaryRow ); | ||
612 | // decreme nt date | ||
613 | d.setDate( d.getDate( ) - 1); | ||
614 | } | ||
615 | |||
616 | befo reEach(fun ction(done ) { | ||
617 | VPC.Layout .content.s how(new Ma rionette.I temView({ | ||
618 | templa te: VPC.Te mplate.pai nDiaryGrap hDetailsTa b, | ||
619 | collec tion: myCo llection | ||
620 | })); | ||
621 | setTimeout (function () { | ||
622 | setFix tures(VPC. Layout.con tent.$el); | ||
623 | done() ; | ||
624 | }, 250); | ||
625 | }); | ||
626 | |||
627 | it(' Verify Gra ph Data bu tton exist s', functi on() { | ||
628 | expect($(' .graphical View')).to BeInDOM(); | ||
629 | }); | ||
630 | it(' Count 30 s cores', fu nction() { | ||
631 | expect($(' #table-tab let-view t able td'). length).to Equal(12); | ||
632 | }); | ||
633 | it(' VPC-3512 - view grap h data but ton', func tion() { | ||
634 | expect($(' .graph-vie w')[0].inn erHTML).to Equal('Vie w Graph Da ta'); | ||
635 | }); | ||
636 | }); | ||
637 | |||
638 | xdescrib e("Complet ed Monthly Check-Ins Report", function() { | ||
639 | var monthlyChe ckLoaded = false; | ||
640 | |||
641 | befo reEach(fun ction (don e) { | ||
642 | jasmine.DE FAULT_TIME OUT_INTERV AL = 35000 00; | ||
643 | if (!month lyCheckLoa ded) { | ||
644 | VPC.ro uter.navig ate('asses sments', { | ||
645 | tr igger: tru e, replace : true | ||
646 | }); | ||
647 | } | ||
648 | else {done ();} | ||
649 | App.vent.o n("assessm ents:loade d", functi on() { | ||
650 | monthl yCheckLoad ed = true; | ||
651 | setTim eout(funct ion () { | ||
652 | do ne(); | ||
653 | }, 250 ); | ||
654 | }); | ||
655 | }); | ||
656 | |||
657 | it(' Confirm He ader text' , function () { | ||
658 | expect($(' #content-t itle').htm l()).toEqu al('<span> Completed Monthly <b r>Check-In s</span>') ; | ||
659 | expect($(' .title-bac k-btn')).t oBeInDOM() ; | ||
660 | }); | ||
661 | |||
662 | it(' Sort butto n present' , function () { | ||
663 | expect($(' #sortBtn') ).toBeInDO M(); | ||
664 | }); | ||
665 | |||
666 | }); | ||
667 | }) ; | ||
668 | xd escribe("C ompleted M onthly Che ck-In Deta ils page", function( ) { | ||
669 | beforeEa ch(functio n() { | ||
670 | var myResponse = new VPC .Model.Che ckInRespon se({ | ||
671 | painIntens ity: 1, | ||
672 | painIntens ityMax: 10 , | ||
673 | painInterf erenceGene ral: 2, | ||
674 | painInterf erenceGene ralMax: 10 , | ||
675 | painInterf erenceLife : 3, | ||
676 | painInterf erenceLife Max: 10, | ||
677 | sleepQuali ty: 4, | ||
678 | sleepQuali tyMax: 10, | ||
679 | pleasureLe vel: 2, | ||
680 | pleasureLe velMax: 3, | ||
681 | depression : 2, | ||
682 | depression Max: 3, | ||
683 | overallSta tus: 3, | ||
684 | overallSta tusMax: 6 | ||
685 | }); | ||
686 | VPC. Layout.con tent.show( new VPC.Vi ew.assessm entsDetail s({ | ||
687 | model: myR esponse | ||
688 | })); | ||
689 | setF ixtures(VP C.Layout.c ontent.$el ); | ||
690 | }); | ||
691 | |||
692 | it('Conf irm Header text', fu nction() { | ||
693 | expe ct($('#con tent-title ').html()) .toEqual(' <span>Comp leted Mont hly <br>Ch eck-In Det ail</span> '); | ||
694 | expe ct($('.tit le-back-bt n')).toBeI nDOM(); | ||
695 | }); | ||
696 | |||
697 | it('VPC- 3532 - Ver ify score removed fr om labels' , function () { | ||
698 | var scoreLabel s = $('th[ class="sco re"]'); | ||
699 | |||
700 | jQue ry.each(sc oreLabels, function( index, ite m) { | ||
701 | expect(ite m.innerTex t).not.toC ontain('Sc ore'); | ||
702 | }); | ||
703 | }); | ||
704 | }) ; | ||
705 | |||
706 | xd escribe("P ain Diary Graph Repo rt", funct ion() { | ||
707 | |||
708 | beforeEa ch(functio n (done) { | ||
709 | jasm ine.DEFAUL T_TIMEOUT_ INTERVAL = 3500000; | ||
710 | App. vent.on("p ainDiaryGr aph:show", function( ) { | ||
711 | setTimeout (function () { | ||
712 | done() ; | ||
713 | }, 250); | ||
714 | }); | ||
715 | |||
716 | VPC. router.nav igate('pai n-diary-gr aph', { | ||
717 | trigger: t rue, repla ce: true | ||
718 | }); | ||
719 | }); | ||
720 | |||
721 | it('Conf irm Header text', fu nction() { | ||
722 | expe ct($('#con tent-title ').html()) .toEqual(' Pain Diary Graph'); | ||
723 | expe ct($('.tit le-back-bt n')).toBeI nDOM(); | ||
724 | }); | ||
725 | }) ; | ||
726 | |||
727 | de scribe("Pa in Diary G raph - gra ph by date ", functio n() { | ||
728 | beforeEa ch(functio n() { | ||
729 | var currentMod el = new V PC.Model.P ainDiary() ; | ||
730 | var num = 1.2; | ||
731 | curr entModel.s et("painRa ting", num .toFixed(1 )); | ||
732 | curr entModel.s et("moveme ntImpact", num.toFix ed(1)); | ||
733 | curr entModel.s et("activi tyInterfer ence", num .toFixed(1 )); | ||
734 | curr entModel.s et("moodEf fect", num .toFixed(1 )); | ||
735 | curr entModel.s et("depres sionLevel" , num.toFi xed(1)); | ||
736 | curr entModel.s et("sleepO utcome", n um.toFixed (1)); | ||
737 | |||
738 | VPC. Layout.con tent.show( new Marion ette.ItemV iew({ | ||
739 | model: cur rentModel, | ||
740 | template: VPC.Templa te.painDia ryGraphRow | ||
741 | })); | ||
742 | setF ixtures(VP C.Layout.c ontent.$el ); | ||
743 | }); | ||
744 | |||
745 | it('Veri fy graph b uttons dis played', f unction() { | ||
746 | expe ct($('.gra ph-categor y-link h3' ).length). toEqual(6) ; | ||
747 | expe ct($('.gra ph-categor y-link h3' )[0].inner HTML).toCo ntain('Pai n Rating') ; | ||
748 | expe ct($('.gra ph-categor y-link h3' )[1].inner HTML).toCo ntain('Enj oyment Int erference' ); | ||
749 | expe ct($('.gra ph-categor y-link h3' )[2].inner HTML).toCo ntain('Gen eral Activ ity Interf erence'); | ||
750 | expe ct($('.gra ph-categor y-link h3' )[3].inner HTML).toCo ntain('Moo d Interfer ence'); | ||
751 | expe ct($('.gra ph-categor y-link h3' )[4].inner HTML).toCo ntain('Dep ression Le vel'); | ||
752 | expe ct($('.gra ph-categor y-link h3' )[5].inner HTML).toCo ntain('Sle ep Quality '); | ||
753 | }); | ||
754 | |||
755 | it('Veri fy icons d isplayed', function( ) { | ||
756 | expe ct($('.gra ph-details img.home- button-ico n').length ).toEqual( 6); | ||
757 | expe ct($('.gra ph-details img.home- button-ico n')[0]).to BeInDOM(); | ||
758 | expe ct($('.gra ph-details img.home- button-ico n')[1]).to BeInDOM(); | ||
759 | expe ct($('.gra ph-details img.home- button-ico n')[2]).to BeInDOM(); | ||
760 | expe ct($('.gra ph-details img.home- button-ico n')[3]).to BeInDOM(); | ||
761 | expe ct($('.gra ph-details img.home- button-ico n')[4]).to BeInDOM(); | ||
762 | expe ct($('.gra ph-details img.home- button-ico n')[5]).to BeInDOM(); | ||
763 | }); | ||
764 | |||
765 | it('Veri fy instruc tions', fu nction() { | ||
766 | expe ct($('sect ion.conten t p')[0].i nnerHTML). toEqual('S elect a ca tegory to see a grap h of your daily diar y entries. '); | ||
767 | }); | ||
768 | //it('Mo vement Int erface ico n', functi on() { | ||
769 | // ex pect($('#i con-progre ss-movemen t-impact-p rov')).toB eInDOM(); | ||
770 | //}); | ||
771 | } ); | ||
772 | |||
773 | de scribe("Pa in Diary G raph Repor t Details - Tabular View", fun ction() { | ||
774 | var myCo llection = new Backb one.Collec tion(); | ||
775 | var d = new Date() ; | ||
776 | // popul ate 30 row s into the collectio n | ||
777 | for (var idx = 0; idx < 30; idx++) { | ||
778 | var painDiaryR ow = new V PC.Model.P ainDiary() ; | ||
779 | pain DiaryRow.s et("dateCr eated", d. toISOStrin g()); | ||
780 | pain DiaryRow.s et("report Date", d.t oISOString ()); | ||
781 | pain DiaryRow.s et("score" , idx % 10 ); | ||
782 | pain DiaryRow.s et("maxSco re", 10); | ||
783 | myCo llection.p ush(painDi aryRow); | ||
784 | // d ecrement d ate | ||
785 | d.se tDate(d.ge tDate() - 1); | ||
786 | } | ||
787 | |||
788 | beforeEa ch(functio n(done) { | ||
789 | VPC. Layout.con tent.show( new Marion ette.ItemV iew({ | ||
790 | template: VPC.Templa te.painDia ryGraphDet ailsTab, | ||
791 | collection : myCollec tion | ||
792 | })); | ||
793 | setT imeout(fun ction () { | ||
794 | setFixture s(VPC.Layo ut.content .$el); | ||
795 | done(); | ||
796 | }, 2 50); | ||
797 | }); | ||
798 | |||
799 | it('Veri fy Graph D ata button exists', function() { | ||
800 | expe ct($('.gra phicalView ')).toBeIn DOM(); | ||
801 | }); | ||
802 | it('Coun t 30 score s', functi on() { | ||
803 | expe ct($('#tab le-tablet- view table td').leng th).toEqua l(30); | ||
804 | }) | ||
805 | }) ; | ||
806 | |||
807 | de scribe("Co mpleted Pa in Diary E ntries", f unction() { | ||
808 | |||
809 | beforeEa ch(functio n (done) { | ||
810 | jasm ine.DEFAUL T_TIMEOUT_ INTERVAL = 3500000; | ||
811 | var ready = 0; | ||
812 | var readyCheck = functio n () { | ||
813 | ready++; | ||
814 | if (ready === 2) { / / set to 2 | ||
815 | setTim eout(funct ion () { | ||
816 | do ne(); | ||
817 | }, 250 ); | ||
818 | } | ||
819 | }; | ||
820 | |||
821 | App. vent.on("p ainDiaryEn tries:load ed", ready Check()); | ||
822 | App. vent.on("p ainDiaryEn tries:rend ered", rea dyCheck()) ; | ||
823 | |||
824 | VPC. router.nav igate('pai n-diary-en tries', { | ||
825 | trigger: t rue, repla ce: true | ||
826 | }); | ||
827 | |||
828 | }); | ||
829 | |||
830 | it('Conf irm Header text', fu nction() { | ||
831 | expe ct($('#con tent-title ').html()) .toEqual(' <span>Comp leted Pain Diary Ent ries</span >'); | ||
832 | expe ct($('.tit le-back-bt n')).toBeI nDOM(); | ||
833 | }); | ||
834 | |||
835 | it('Sort button pr esent', fu nction() { | ||
836 | expe ct($('#sor tBtn')).to BeInDOM(); | ||
837 | }); | ||
838 | }) ; | ||
839 | |||
840 | }); | ||
841 | |||
842 | descri be("Learn" , function () { | ||
843 | af terEach(fu nction() { | ||
844 | VPC.Layo ut.content .empty(); | ||
845 | }) ; | ||
846 | |||
847 | de scribe("Le arn Main M enu", func tion() { | ||
848 | beforeEa ch(functio n() { | ||
849 | VPC. Layout.con tent.show( new VPC.Vi ew.learn); | ||
850 | setF ixtures(VP C.Layout.c ontent.$el ); | ||
851 | }); | ||
852 | it('Conf irm Header text', fu nction() { | ||
853 | expe ct($('#con tent-title ').html()) .toEqual(' Learn'); | ||
854 | }); | ||
855 | it('Back button pr esent', fu nction() { | ||
856 | expe ct($('.tit le-back-bt n')).toBeI nDOM(); | ||
857 | }); | ||
858 | }) ; | ||
859 | de scribe("Wh at is Chro nic Pain?" , function () { | ||
860 | beforeEa ch(functio n() { | ||
861 | VPC. Layout.con tent.show( new VPC.Vi ew.chronic Pain); | ||
862 | setF ixtures(VP C.Layout.c ontent.$el ); | ||
863 | }); | ||
864 | |||
865 | it('Back button pr esent', fu nction() { | ||
866 | expe ct($('.tit le-back-bt n')).toBeI nDOM(); | ||
867 | }); | ||
868 | }) ; | ||
869 | de scribe("Th ings that Affect Pai n", functi on() { | ||
870 | beforeEa ch(functio n() { | ||
871 | VPC. Layout.con tent.show( new VPC.Vi ew.affectP ain); | ||
872 | setF ixtures(VP C.Layout.c ontent.$el ); | ||
873 | }); | ||
874 | |||
875 | it('Back button pr esent', fu nction() { | ||
876 | expe ct($('.tit le-back-bt n')).toBeI nDOM(); | ||
877 | }); | ||
878 | }) ; | ||
879 | de scribe("Ca regiver In formation" , function () { | ||
880 | beforeEa ch(functio n() { | ||
881 | VPC. Layout.con tent.show( new VPC.Vi ew.caregiv erInfo); | ||
882 | setF ixtures(VP C.Layout.c ontent.$el ); | ||
883 | }); | ||
884 | |||
885 | it('Back button pr esent', fu nction() { | ||
886 | expe ct($('.tit le-back-bt n')).toBeI nDOM(); | ||
887 | }); | ||
888 | }) ; | ||
889 | }); | ||
890 | |||
891 | descri be("Pain T oolbox", f unction() { | ||
892 | |||
893 | de scribe("To ols Main M enu", func tion() { | ||
894 | beforeEa ch(functio n() { | ||
895 | VPC. Layout.con tent.show( new VPC.Vi ew.tools); | ||
896 | setF ixtures(VP C.Layout.c ontent.$el ); | ||
897 | }); | ||
898 | it('Conf irm Header text', fu nction() { | ||
899 | expe ct($('#con tent-title ').html()) .toEqual(' Pain Toolb ox'); | ||
900 | }); | ||
901 | it('Back button pr esent', fu nction() { | ||
902 | expe ct($('.tit le-back-bt n')).toBeI nDOM(); | ||
903 | }); | ||
904 | |||
905 | it('Slee p Tip icon ', functio n() { | ||
906 | expe ct($('#ico n-tool-sle ep')).toBe InDOM(); | ||
907 | }); | ||
908 | }) ; | ||
909 | |||
910 | xd escribe("M uscle Rela xation", f unction() { | ||
911 | afterEac h(function () { | ||
912 | VPC. Layout.con tent.empty (); | ||
913 | }); | ||
914 | |||
915 | describe ('Muscle R elaxation start page ', functio n() { | ||
916 | befo reEach(fun ction() { | ||
917 | VPC.Layout .content.s how(new VP C.View.mus cleRelaxat ion()); | ||
918 | setFixture s(VPC.Layo ut.content .$el); | ||
919 | }); | ||
920 | it(' Confirm He ader text' , function () { | ||
921 | expect($(' #content-t itle').htm l()).toEqu al('Muscle Relaxatio n'); | ||
922 | }); | ||
923 | it(' Back butto n present' , function () { | ||
924 | expect($(' .title-bac k-btn')).t oBeInDOM() ; | ||
925 | }); | ||
926 | }); | ||
927 | |||
928 | describe ('Muscle R elaxation main page' , function () { | ||
929 | befo reEach(fun ction() { | ||
930 | VPC.Layout .content.s how(new VP C.View.rel axation()) ; | ||
931 | setFixture s(VPC.Layo ut.content .$el); | ||
932 | }); | ||
933 | it(' Confirm He ader text' , function () { | ||
934 | expect($(' #content-t itle').htm l()).toEqu al('Muscle Relaxatio n'); | ||
935 | }); | ||
936 | it(' Back butto n present' , function () { | ||
937 | expect($(' .title-bac k-btn')).t oBeInDOM() ; | ||
938 | }); | ||
939 | it(' Verify vid eo is on p age', func tion() { | ||
940 | expect($(' video')).t oBeInDOM() ; | ||
941 | }); | ||
942 | }); | ||
943 | }) ; | ||
944 | |||
945 | xd escribe("A ctivity Pa cing Tool" , function () { | ||
946 | afterEac h(function () { | ||
947 | VPC. Layout.con tent.empty (); | ||
948 | }); | ||
949 | describe ("Activity Pacing St art page", function( ) { | ||
950 | befo reEach(fun ction() { | ||
951 | VPC.Layout .content.s how(new VP C.View.act ivityPacin g()); | ||
952 | setFixture s(VPC.Layo ut.content .$el); | ||
953 | }); | ||
954 | it(' Confirm He ader text' , function () { | ||
955 | expect($(' #content-t itle').htm l()).toEqu al('Activi ty Pacing' ); | ||
956 | }); | ||
957 | it(' Back butto n present' , function () { | ||
958 | expect($(' .title-bac k-btn')).t oBeInDOM() ; | ||
959 | }); | ||
960 | }); | ||
961 | describe ("List of Activity P acing", fu nction() { | ||
962 | befo reEach(fun ction() { | ||
963 | VPC.Layout .content.s how(new VP C.View.act ivityPacin g({action: "list"})) ; | ||
964 | setFixture s(VPC.Layo ut.content .$el); | ||
965 | }); | ||
966 | it(' Confirm He ader text' , function () { | ||
967 | expect($(' #content-t itle').htm l()).toEqu al('Activi ty Pacing' ); | ||
968 | }); | ||
969 | it(' Back butto n present' , function () { | ||
970 | expect($(' .title-bac k-btn')).t oBeInDOM() ; | ||
971 | }); | ||
972 | }); | ||
973 | describe ("Activity Pacing De tails", fu nction() { | ||
974 | befo reEach(fun ction() { | ||
975 | VPC.Layout .content.s how(new VP C.View.act ivityPacin g({action: "details" })); | ||
976 | setFixture s(VPC.Layo ut.content .$el); | ||
977 | }); | ||
978 | it(' Confirm He ader text' , function () { | ||
979 | expect($(' #content-t itle').htm l()).toEqu al('Activi ty Pacing' ); | ||
980 | }); | ||
981 | it(' Back butto n present' , function () { | ||
982 | expect($(' .title-bac k-btn')).t oBeInDOM() ; | ||
983 | }); | ||
984 | |||
985 | it(' Tooltips o n page', f unction() { | ||
986 | expect($(' #info-btn- pace')).to BeInDOM(); | ||
987 | expect($(' #info-btn- tip')).toB eInDOM(); | ||
988 | }); | ||
989 | }); | ||
990 | }) ; | ||
991 | }); | ||
992 | |||
993 | //THIS SHOULD AL WAYS BE LA ST. THIS W ILL KILL T HE SESSION | ||
994 | xdescr ibe("User times out or logs ou t of appli cation", f unction () { | ||
995 | de scribe("To ken should be delete d", functi on () { | ||
996 | var toke n = false; | ||
997 | beforeEa ch(functio n (done) { | ||
998 | App. vent.on('t est-token: deleted', function ( ) { | ||
999 | token = tr ue; | ||
1000 | done(); | ||
1001 | }); | ||
1002 | VPC. Model.Dele teToken = new VPC.Mo del.delete Token(); | ||
1003 | VPC. Model.Dele teToken.de stroy({ | ||
1004 | dataType: "text", | ||
1005 | contentTyp e: false, | ||
1006 | processDat a: false, | ||
1007 | complete: function ( model, res ponse) { | ||
1008 | App.ve nt.trigger ('test-tok en:deleted '); | ||
1009 | } | ||
1010 | }); | ||
1011 | }); | ||
1012 | it('Toke n delete r equest was successfu l', functi on () { | ||
1013 | expe ct(token). toBe(true) ; | ||
1014 | }); | ||
1015 | }) ; | ||
1016 | de scribe("se ssionStora ge token s hould be d eleted", f unction () { | ||
1017 | var toke n = false; | ||
1018 | beforeEa ch(functio n () { | ||
1019 | App_ Utils.Clea rSessionTo ken('token '); | ||
1020 | }); | ||
1021 | it('Toke n is null' , function () { | ||
1022 | expe ct(App_Uti ls.GetSess ionToken() ).toBe(nul l); | ||
1023 | }); | ||
1024 | }) ; | ||
1025 | de scribe("JS ESSIONID c ookie shou ld be dele ted", func tion () { | ||
1026 | var cook ie = false ; | ||
1027 | beforeEa ch(functio n () { | ||
1028 | App_ Utils.Dele teCookie(' JSESSIONID '); | ||
1029 | }); | ||
1030 | it('Cook ie does no t exist', function ( ) { | ||
1031 | expe ct(App_Uti ls.CookieE xists('JSE SSIONID')) .toBe(fals e); | ||
1032 | }); | ||
1033 | }) ; | ||
1034 | }); | ||
1035 | }); | ||
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.