unittests/tests/widget.js
author hamidouk
Mon, 24 Oct 2011 12:42:15 +0200
branchpopcorn-port
changeset 124 2758dfb208b2
parent 119 29d6d634cbdf
child 170 5150ae56e0a6
permissions -rw-r--r--
changed widget.js to add some properties to the widget. Widgets now only get the gui options as a parameter instead of the whole configuration.

/* test module for base widgets */
function test_widget() {
  module("Base widget testing", 
  {setup : function() {
    this.Popcorn = Popcorn.youtube("#popcorn-div", "http://www.youtube.com/watch?v=QH2-TGUlwu4");
    
    this.dt = new IriSP.DataLoader();
    this.ser = new IriSP.JSONSerializer(this.dt, "/url");
  } }
  );
  
  test("test initialisation", function() {
    var config = { container: "mydiv", width: 640, height: 480};
    var wid = new IriSP.Widget(this.Popcorn, config, this.ser);
    deepEqual(wid._config, config, "Check if the parent div is set correctly");
    ok(wid.selector, "Check if the jquery selector is set");
    
  });
  
  
};