1 $(document).ready(function() { |
1 $(document).ready(function() { |
2 |
2 |
3 module("module2", { |
3 QUnit.module("module2", { |
4 setup: function() { |
4 setup: function() { |
5 $('#qunit-fixture').append('<select id="theselect" multiple="multiple" size="2">' + |
5 $('#qunit-fixture').append('<select id="theselect" multiple="multiple" size="2">' + |
6 '</select>'); |
6 '</select>'); |
7 } |
7 } |
8 }); |
8 }); |
9 |
9 |
10 test("test first selected", function() { |
10 QUnit.test("test first selected", function() { |
11 $('#theselect').append('<option value="foo">foo</option>' + |
11 $('#theselect').append('<option value="foo">foo</option>' + |
12 '<option selected="selected" value="bar">bar</option>' + |
12 '<option selected="selected" value="bar">bar</option>' + |
13 '<option value="baz">baz</option>' + |
13 '<option value="baz">baz</option>' + |
14 '<option selected="selecetd"value="spam">spam</option>'); |
14 '<option selected="selecetd"value="spam">spam</option>'); |
15 var selected = firstSelected(document.getElementById("theselect")); |
15 var selected = firstSelected(document.getElementById("theselect")); |
16 equal(selected.value, 'bar'); |
16 equal(selected.value, 'bar'); |
17 }); |
17 }); |
18 |
18 |
19 test("test first selected 2", function() { |
19 QUnit.test("test first selected 2", function() { |
20 $('#theselect').append('<option value="foo">foo</option>' + |
20 $('#theselect').append('<option value="foo">foo</option>' + |
21 '<option value="bar">bar</option>' + |
21 '<option value="bar">bar</option>' + |
22 '<option value="baz">baz</option>' + |
22 '<option value="baz">baz</option>' + |
23 '<option value="spam">spam</option>'); |
23 '<option value="spam">spam</option>'); |
24 var selected = firstSelected(document.getElementById("theselect")); |
24 var selected = firstSelected(document.getElementById("theselect")); |
25 equal(selected, null); |
25 equal(selected, null); |
26 }); |
26 }); |
27 |
27 |
28 module("visibilty"); |
28 QUnit.module("visibilty"); |
29 test('toggleVisibility', function() { |
29 QUnit.test('toggleVisibility', function() { |
30 $('#qunit-fixture').append('<div id="foo"></div>'); |
30 $('#qunit-fixture').append('<div id="foo"></div>'); |
31 toggleVisibility('foo'); |
31 toggleVisibility('foo'); |
32 ok($('#foo').hasClass('hidden'), 'check hidden class is set'); |
32 ok($('#foo').hasClass('hidden'), 'check hidden class is set'); |
33 }); |
33 }); |
34 |
34 |