25 |
25 |
26 test("test widget initialization", function() { |
26 test("test widget initialization", function() { |
27 var widget = new IriSP.SliderWidget(this.Popcorn, this.config, this.ser); |
27 var widget = new IriSP.SliderWidget(this.Popcorn, this.config, this.ser); |
28 widget.draw(); |
28 widget.draw(); |
29 |
29 |
30 ok(IriSP.jQuery("#widget-div").hasClass("ui-slider"), "test if the div has been set-up"); |
30 ok(IriSP.jQuery("#widget-div").children().hasClass("sliderBackground"), "test if the div has been set-up"); |
|
31 ok(IriSP.jQuery("#widget-div").children().hasClass("sliderForeground"), "test if the div has been set-up"); |
31 |
32 |
32 }); |
33 }); |
33 |
34 |
34 test("test slider seeking", function() { |
35 test("test slider seeking", function() { |
35 var widget = new IriSP.SliderWidget(this.Popcorn, this.config, this.ser); |
36 var widget = new IriSP.SliderWidget(this.Popcorn, this.config, this.ser); |
36 widget.draw(); |
37 widget.draw(); |
37 |
38 |
38 var spy_callback = this.spy(); |
39 var spy_callback = this.spy(); |
39 widget._Popcorn.listen("test.fixture", spy_callback); |
40 widget._Popcorn.listen("timeupdate", spy_callback); |
40 IriSP.jQuery("#widget-div").slider("value", 30); |
41 IriSP.jQuery("#widget-div").children().click(); |
41 ok(spy_callback.called, "handling function has been called"); |
42 ok(spy_callback.called, "handling function has been called"); |
42 }); |
43 }); |
43 } |
44 } |