unittests/tests/widget.js
branchnew-model
changeset 924 64c2eaafe5e2
parent 923 b3ee7d1b472a
child 925 28efc97b5d78
equal deleted inserted replaced
923:b3ee7d1b472a 924:64c2eaafe5e2
     1 /* test module for base widgets */
       
     2 function test_widget() {
       
     3   module("Base widget testing", 
       
     4   {setup : function() {
       
     5     this.Popcorn = Popcorn("#popcorn-div");
       
     6     
       
     7     this.dt = new IriSP.DataLoader();
       
     8     this.ser = new IriSP.JSONSerializer(this.dt, "/url");
       
     9   } }
       
    10   );
       
    11   
       
    12   test("test initialisation", function() {
       
    13     var config = { container: "mydiv", width: 640, height: 480};
       
    14     var wid = new IriSP.Widget(this.Popcorn, config, this.ser);
       
    15     deepEqual(wid._config, config, "Check if the parent div is set correctly");
       
    16     ok(wid.selector, "Check if the jquery selector is set");
       
    17     
       
    18   });
       
    19   
       
    20   test("test initialisation with more values", function() {
       
    21     var config = { container: "mydiv", widthmax: 640, heightmax: 480};
       
    22     var wid = new IriSP.Widget(this.Popcorn, config, this.ser);
       
    23     deepEqual(wid._config, config, "Check if the parent div is set correctly");
       
    24     ok(wid.selector, "Check if the jquery selector is set");
       
    25     
       
    26   });
       
    27   
       
    28   
       
    29 };