unittests/tests/widget.js
author hamidouk
Mon, 19 Dec 2011 15:25:22 +0100
branchpopcorn-port
changeset 481 a46cfeee6d77
parent 428 9246dce433f8
permissions -rw-r--r--
using jquery ui draggable changes the state of an element from absolute to relative positioning, which breaks the way our seek button expands itself, so we need to force absolute positioning, quite uglily, using jquery.

/* test module for base widgets */
function test_widget() {
  module("Base widget testing", 
  {setup : function() {
    this.Popcorn = Popcorn("#popcorn-div");
    
    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");
    
  });
  
  test("test initialisation with more values", function() {
    var config = { container: "mydiv", widthmax: 640, heightmax: 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");
    
  });
  
  
};