diff -r cb091d204ba9 -r a938013fc6ea unittests/tests/widgets/segmentsWidget.js --- a/unittests/tests/widgets/segmentsWidget.js Wed Nov 23 10:40:06 2011 +0100 +++ b/unittests/tests/widgets/segmentsWidget.js Wed Nov 23 11:13:21 2011 +0100 @@ -40,15 +40,18 @@ var widget = new IriSP.SegmentsWidget(this.Popcorn, this.config, this.ser); widget.draw(); - var spy_callback = this.spy(); + var spy_timeupdate = this.spy(); + var spy_segmentClick = this.spy(); var spy_handler = sinon.spy(widget, "clickHandler"); - this.Popcorn.listen("timeupdate", spy_callback); + this.Popcorn.listen("timeupdate", spy_timeupdate); + this.Popcorn.listen("IriSP.SegmentsWidget.segmentClick", spy_segmentClick); var selector = IriSP.jQuery("#widget-div :not(first-child)"); var random = Math.round(Math.random() * selector.length) + 1; selector.eq(random).click(); - ok(spy_callback.called, "the currenttime was changed"); + ok(spy_timeupdate.called, "the timeupdate signal has been sent"); + ok(spy_segmentClick.called, "the IriSP.segmentClick signal has been sent"); ok(spy_handler.called, "handling function has been called"); }); @@ -64,4 +67,4 @@ var newStyle = IriSP.jQuery("#widget-div").children(tag_id).attr("style"); notEqual(oldStyle, newStyle, "the segment style has been modified"); }); -}; \ No newline at end of file +};