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.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
74
d7a7d7216371 lots of changes to the player widget...
hamidouk
parents:
diff changeset
     1
/* test module for base widgets */
d7a7d7216371 lots of changes to the player widget...
hamidouk
parents:
diff changeset
     2
function test_widget() {
d7a7d7216371 lots of changes to the player widget...
hamidouk
parents:
diff changeset
     3
  module("Base widget testing", 
d7a7d7216371 lots of changes to the player widget...
hamidouk
parents:
diff changeset
     4
  {setup : function() {
428
9246dce433f8 form fixes here and there.
hamidouk
parents: 170
diff changeset
     5
    this.Popcorn = Popcorn("#popcorn-div");
74
d7a7d7216371 lots of changes to the player widget...
hamidouk
parents:
diff changeset
     6
    
d7a7d7216371 lots of changes to the player widget...
hamidouk
parents:
diff changeset
     7
    this.dt = new IriSP.DataLoader();
d7a7d7216371 lots of changes to the player widget...
hamidouk
parents:
diff changeset
     8
    this.ser = new IriSP.JSONSerializer(this.dt, "/url");
d7a7d7216371 lots of changes to the player widget...
hamidouk
parents:
diff changeset
     9
  } }
d7a7d7216371 lots of changes to the player widget...
hamidouk
parents:
diff changeset
    10
  );
d7a7d7216371 lots of changes to the player widget...
hamidouk
parents:
diff changeset
    11
  
d7a7d7216371 lots of changes to the player widget...
hamidouk
parents:
diff changeset
    12
  test("test initialisation", function() {
124
2758dfb208b2 changed widget.js to add some properties to the widget. Widgets now only get the
hamidouk
parents: 119
diff changeset
    13
    var config = { container: "mydiv", width: 640, height: 480};
114
eda061f1aa75 added a .selector object to all the widgets.
hamidouk
parents: 74
diff changeset
    14
    var wid = new IriSP.Widget(this.Popcorn, config, this.ser);
eda061f1aa75 added a .selector object to all the widgets.
hamidouk
parents: 74
diff changeset
    15
    deepEqual(wid._config, config, "Check if the parent div is set correctly");
eda061f1aa75 added a .selector object to all the widgets.
hamidouk
parents: 74
diff changeset
    16
    ok(wid.selector, "Check if the jquery selector is set");
74
d7a7d7216371 lots of changes to the player widget...
hamidouk
parents:
diff changeset
    17
    
d7a7d7216371 lots of changes to the player widget...
hamidouk
parents:
diff changeset
    18
  });
d7a7d7216371 lots of changes to the player widget...
hamidouk
parents:
diff changeset
    19
  
170
5150ae56e0a6 added two new config values for a widget : heightmax and widthmax.
hamidouk
parents: 124
diff changeset
    20
  test("test initialisation with more values", function() {
5150ae56e0a6 added two new config values for a widget : heightmax and widthmax.
hamidouk
parents: 124
diff changeset
    21
    var config = { container: "mydiv", widthmax: 640, heightmax: 480};
5150ae56e0a6 added two new config values for a widget : heightmax and widthmax.
hamidouk
parents: 124
diff changeset
    22
    var wid = new IriSP.Widget(this.Popcorn, config, this.ser);
5150ae56e0a6 added two new config values for a widget : heightmax and widthmax.
hamidouk
parents: 124
diff changeset
    23
    deepEqual(wid._config, config, "Check if the parent div is set correctly");
5150ae56e0a6 added two new config values for a widget : heightmax and widthmax.
hamidouk
parents: 124
diff changeset
    24
    ok(wid.selector, "Check if the jquery selector is set");
5150ae56e0a6 added two new config values for a widget : heightmax and widthmax.
hamidouk
parents: 124
diff changeset
    25
    
5150ae56e0a6 added two new config values for a widget : heightmax and widthmax.
hamidouk
parents: 124
diff changeset
    26
  });
5150ae56e0a6 added two new config values for a widget : heightmax and widthmax.
hamidouk
parents: 124
diff changeset
    27
  
74
d7a7d7216371 lots of changes to the player widget...
hamidouk
parents:
diff changeset
    28
  
428
9246dce433f8 form fixes here and there.
hamidouk
parents: 170
diff changeset
    29
};