unittests/tests/widgets/segmentsWidget.js
branchpopcorn-port
changeset 321 21d840371c6b
parent 304 a938013fc6ea
child 427 440ffc18f827
equal deleted inserted replaced
320:b693ba1a83be 321:21d840371c6b
    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