unittests/tests/segmentsWidget.js
branchpopcorn-port
changeset 217 ec3e6d34462c
parent 164 d335ee5533c5
child 219 12a72b00f4ab
equal deleted inserted replaced
216:d1e891627286 217:ec3e6d34462c
    28   test("test widget initialization", function() {  
    28   test("test widget initialization", function() {  
    29     var widget = new IriSP.SegmentsWidget(this.Popcorn, this.config, this.ser);    
    29     var widget = new IriSP.SegmentsWidget(this.Popcorn, this.config, this.ser);    
    30     widget.draw();
    30     widget.draw();
    31   
    31   
    32     equal(IriSP.jQuery("#widget-div").length, 1, "test if the div has been added correctly");
    32     equal(IriSP.jQuery("#widget-div").length, 1, "test if the div has been added correctly");
    33     equal(IriSP.jQuery("#widget-div").children().length, this.ser._data.annotations.length, "test if children have been added correctly");
    33     // the + 1 is because we have a z-index div to indicate progress in the video.
       
    34     equal(IriSP.jQuery("#widget-div").children().length, this.ser._data.annotations.length + 1, "test if children have been added correctly");
    34   });
    35   });
    35   
    36   
    36   test("test click on a random segment", function() {
    37   test("test click on a random segment", function() {
    37     var widget = new IriSP.SegmentsWidget(this.Popcorn, this.config, this.ser);
    38     var widget = new IriSP.SegmentsWidget(this.Popcorn, this.config, this.ser);
    38     widget.draw();
    39     widget.draw();