42 |
42 |
43 var spy_timeupdate = this.spy(); |
43 var spy_timeupdate = this.spy(); |
44 var spy_segmentClick = this.spy(); |
44 var spy_segmentClick = this.spy(); |
45 var spy_handler = sinon.spy(widget, "clickHandler"); |
45 var spy_handler = sinon.spy(widget, "clickHandler"); |
46 this.Popcorn.listen("timeupdate", spy_timeupdate); |
46 this.Popcorn.listen("timeupdate", spy_timeupdate); |
47 this.Popcorn.listen("IriSP.SegmentsWidget.segmentClick", spy_segmentClick); |
|
48 |
47 |
49 var selector = IriSP.jQuery("#widget-div :not(first-child)"); |
48 var selector = IriSP.jQuery("#widget-div :not(first-child)"); |
50 var random = Math.round(Math.random() * selector.length) + 1; |
49 var random = Math.round(Math.random() * selector.length) + 1; |
51 selector.eq(random).click(); |
50 selector.eq(random).click(); |
52 |
51 |
53 ok(spy_timeupdate.called, "the timeupdate signal has been sent"); |
52 ok(spy_timeupdate.called, "the timeupdate signal has been sent"); |
54 ok(spy_segmentClick.called, "the IriSP.segmentClick signal has been sent"); |
|
55 ok(spy_handler.called, "handling function has been called"); |
53 ok(spy_handler.called, "handling function has been called"); |
56 }); |
54 }); |
57 |
55 |
58 test("test search highlight features", function() { |
56 test("test search highlight features", function() { |
59 |
57 |