|
113 | 113 | var expectedValue = 50; |
114 | 114 | helper.moveMouseToValue(expectedValue); |
115 | 115 | expect(helper.scope.slider.min).to.equal(expectedValue); |
116 | | - helper.slider.positionTrackingHandle.called.should.be.true; |
117 | | - helper.slider.callOnChange.called.should.be.true; |
| 116 | + expect(helper.slider.positionTrackingHandle.callCount).to.equal(1); |
| 117 | + expect(helper.slider.callOnChange.callCount).to.equal(1); |
118 | 118 | }); |
119 | 119 |
|
120 | 120 | it('should handle click and drag on maxH correctly when mouse is on the middle', function() { |
|
124 | 124 | var expectedValue = 50; |
125 | 125 | helper.moveMouseToValue(expectedValue); |
126 | 126 | expect(helper.scope.slider.max).to.equal(expectedValue); |
127 | | - helper.slider.positionTrackingHandle.called.should.be.true; |
128 | | - helper.slider.callOnChange.called.should.be.true; |
| 127 | + expect(helper.slider.positionTrackingHandle.callCount).to.equal(1); |
| 128 | + expect(helper.slider.callOnChange.callCount).to.equal(1); |
129 | 129 | }); |
130 | 130 |
|
131 | 131 | it('should handle click and drag on minH and switch min/max if needed', function() { |
|
204 | 204 | expect(helper.scope.slider.min).to.equal(expectedValue); |
205 | 205 | expect(helper.slider.tracking).to.equal('lowValue'); |
206 | 206 | helper.slider.focusElement.calledWith(helper.slider.minH).should.be.true; |
207 | | - helper.slider.positionTrackingHandle.called.should.be.true; |
208 | | - helper.slider.callOnStart.called.should.be.true; |
209 | | - helper.slider.callOnChange.called.should.be.true; |
| 207 | + expect(helper.slider.positionTrackingHandle.callCount).to.equal(1); |
| 208 | + expect(helper.slider.callOnStart.callCount).to.equal(1); |
| 209 | + expect(helper.slider.callOnChange.callCount).to.equal(1); |
210 | 210 | }); |
211 | 211 |
|
212 | 212 | it('should handle click on fullbar and move maxH when click pos is nearer to maxH', function() { |
|
223 | 223 | expect(helper.scope.slider.max).to.equal(expectedValue); |
224 | 224 | expect(helper.slider.tracking).to.equal('highValue'); |
225 | 225 | helper.slider.focusElement.calledWith(helper.slider.maxH).should.be.true; |
226 | | - helper.slider.positionTrackingHandle.called.should.be.true; |
227 | | - helper.slider.callOnStart.called.should.be.true; |
228 | | - helper.slider.callOnChange.called.should.be.true; |
| 226 | + expect(helper.slider.positionTrackingHandle.callCount).to.equal(1); |
| 227 | + expect(helper.slider.callOnStart.callCount).to.equal(1); |
| 228 | + expect(helper.slider.callOnChange.callCount).to.equal(1); |
229 | 229 | }); |
230 | 230 |
|
231 | 231 | it('should handle click on selbar and move minH when click pos is nearer to minH', function() { |
|
242 | 242 | expect(helper.scope.slider.min).to.equal(expectedValue); |
243 | 243 | expect(helper.slider.tracking).to.equal('lowValue'); |
244 | 244 | helper.slider.focusElement.calledWith(helper.slider.minH).should.be.true; |
245 | | - helper.slider.positionTrackingHandle.called.should.be.true; |
246 | | - helper.slider.callOnStart.called.should.be.true; |
247 | | - helper.slider.callOnChange.called.should.be.true; |
| 245 | + expect(helper.slider.positionTrackingHandle.callCount).to.equal(1); |
| 246 | + expect(helper.slider.callOnStart.callCount).to.equal(1); |
| 247 | + expect(helper.slider.callOnChange.callCount).to.equal(1); |
248 | 248 | }); |
249 | 249 |
|
250 | 250 | it('should handle click on selbar and move maxH when click pos is nearer to maxH', function() { |
|
261 | 261 | expect(helper.scope.slider.max).to.equal(expectedValue); |
262 | 262 | expect(helper.slider.tracking).to.equal('highValue'); |
263 | 263 | helper.slider.focusElement.calledWith(helper.slider.maxH).should.be.true; |
264 | | - helper.slider.positionTrackingHandle.called.should.be.true; |
265 | | - helper.slider.callOnStart.called.should.be.true; |
266 | | - helper.slider.callOnChange.called.should.be.true; |
| 264 | + expect(helper.slider.positionTrackingHandle.callCount).to.equal(1); |
| 265 | + expect(helper.slider.callOnStart.callCount).to.equal(1); |
| 266 | + expect(helper.slider.callOnChange.callCount).to.equal(1); |
267 | 267 | }); |
268 | 268 | }); |
269 | 269 |
|
|
380 | 380 | var expectedValue = 50; |
381 | 381 | helper.moveMouseToValue(expectedValue); |
382 | 382 | expect(helper.scope.slider.min).to.equal(expectedValue); |
383 | | - helper.slider.positionTrackingHandle.called.should.be.true; |
384 | | - helper.slider.callOnChange.called.should.be.true; |
| 383 | + expect(helper.slider.positionTrackingHandle.callCount).to.equal(1); |
| 384 | + expect(helper.slider.callOnChange.callCount).to.equal(1); |
385 | 385 | }); |
386 | 386 |
|
387 | 387 | it('should handle click and drag on maxH correctly when mouse is on the middle', function() { |
|
391 | 391 | var expectedValue = 50; |
392 | 392 | helper.moveMouseToValue(expectedValue); |
393 | 393 | expect(helper.scope.slider.max).to.equal(expectedValue); |
394 | | - helper.slider.positionTrackingHandle.called.should.be.true; |
395 | | - helper.slider.callOnChange.called.should.be.true; |
| 394 | + expect(helper.slider.positionTrackingHandle.callCount).to.equal(1); |
| 395 | + expect(helper.slider.callOnChange.callCount).to.equal(1); |
396 | 396 | }); |
397 | 397 |
|
398 | 398 | it('should handle click and drag on minH and switch min/max if needed', function() { |
|
471 | 471 | expect(helper.scope.slider.min).to.equal(expectedValue); |
472 | 472 | expect(helper.slider.tracking).to.equal('lowValue'); |
473 | 473 | helper.slider.focusElement.calledWith(helper.slider.minH).should.be.true; |
474 | | - helper.slider.positionTrackingHandle.called.should.be.true; |
475 | | - helper.slider.callOnStart.called.should.be.true; |
476 | | - helper.slider.callOnChange.called.should.be.true; |
| 474 | + expect(helper.slider.positionTrackingHandle.callCount).to.equal(1); |
| 475 | + expect(helper.slider.callOnStart.callCount).to.equal(1); |
| 476 | + expect(helper.slider.callOnChange.callCount).to.equal(1); |
477 | 477 | }); |
478 | 478 |
|
479 | 479 | it('should handle click on fullbar and move maxH when click pos is nearer to maxH', function() { |
|
490 | 490 | expect(helper.scope.slider.max).to.equal(expectedValue); |
491 | 491 | expect(helper.slider.tracking).to.equal('highValue'); |
492 | 492 | helper.slider.focusElement.calledWith(helper.slider.maxH).should.be.true; |
493 | | - helper.slider.positionTrackingHandle.called.should.be.true; |
494 | | - helper.slider.callOnStart.called.should.be.true; |
495 | | - helper.slider.callOnChange.called.should.be.true; |
| 493 | + expect(helper.slider.positionTrackingHandle.callCount).to.equal(1); |
| 494 | + expect(helper.slider.callOnStart.callCount).to.equal(1); |
| 495 | + expect(helper.slider.callOnChange.callCount).to.equal(1); |
496 | 496 | }); |
497 | 497 |
|
498 | 498 | it('should handle click on selbar and move minH when click pos is nearer to minH', function() { |
|
509 | 509 | expect(helper.scope.slider.min).to.equal(expectedValue); |
510 | 510 | expect(helper.slider.tracking).to.equal('lowValue'); |
511 | 511 | helper.slider.focusElement.calledWith(helper.slider.minH).should.be.true; |
512 | | - helper.slider.positionTrackingHandle.called.should.be.true; |
513 | | - helper.slider.callOnStart.called.should.be.true; |
514 | | - helper.slider.callOnChange.called.should.be.true; |
| 512 | + expect(helper.slider.positionTrackingHandle.callCount).to.equal(1); |
| 513 | + expect(helper.slider.callOnStart.callCount).to.equal(1); |
| 514 | + expect(helper.slider.callOnChange.callCount).to.equal(1); |
515 | 515 | }); |
516 | 516 |
|
517 | 517 | it('should handle click on selbar and move maxH when click pos is nearer to maxH', function() { |
|
528 | 528 | expect(helper.scope.slider.max).to.equal(expectedValue); |
529 | 529 | expect(helper.slider.tracking).to.equal('highValue'); |
530 | 530 | helper.slider.focusElement.calledWith(helper.slider.maxH).should.be.true; |
531 | | - helper.slider.positionTrackingHandle.called.should.be.true; |
532 | | - helper.slider.callOnStart.called.should.be.true; |
533 | | - helper.slider.callOnChange.called.should.be.true; |
| 531 | + expect(helper.slider.positionTrackingHandle.callCount).to.equal(1); |
| 532 | + expect(helper.slider.callOnStart.callCount).to.equal(1); |
| 533 | + expect(helper.slider.callOnChange.callCount).to.equal(1); |
534 | 534 | }); |
535 | 535 | }); |
536 | 536 | }()); |
537 | | - |
0 commit comments