unittests/tests/widget.js
author hamidouk
Wed, 26 Oct 2011 11:32:21 +0200
branchpopcorn-port
changeset 147 955119f901b4
parent 124 2758dfb208b2
child 170 5150ae56e0a6
permissions -rw-r--r--
added a function to search annotations to the json serializer.

/* 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");
    
  });
  
  
};