unittests/tests/widget.js
author hamidouk
Fri, 21 Oct 2011 14:06:29 +0200
branchpopcorn-port
changeset 114 eda061f1aa75
parent 74 d7a7d7216371
child 119 29d6d634cbdf
permissions -rw-r--r--
added a .selector object to all the widgets.

/* 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 = {divId: "mydiv"};
    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");
    
  });
  
  
};