Index: trunk/extensions/MobileFrontend/tests/js/test_application.js |
— | — | @@ -1,14 +1,22 @@ |
2 | 2 | var MFE = MobileFrontend; |
3 | 3 | var MFET = window.MobileFrontendTests; |
4 | 4 | |
5 | | -module("MobileFrontend application.js: utils"); |
| 5 | +module("MobileFrontend application.js: utils", { |
| 6 | + setup: function() { |
| 7 | + var section = '<div class="t_section_heading"></div>'; |
| 8 | + $('<div id="mfetest">' + section + '<div id="t_section_1">' + section + '</div>').appendTo(document.body); |
| 9 | + }, |
| 10 | + teardown: function() { |
| 11 | + $("#mfetest").remove(); |
| 12 | + } |
| 13 | +}); |
6 | 14 | |
7 | 15 | test("Basic selector support (#id)", function() { |
8 | | - strictEqual(MFE.utils("#section_1").length, 1, "only one element matches this selector"); |
| 16 | + strictEqual(MFE.utils("#t_section_1").length, 1, "only one element matches this selector"); |
9 | 17 | }); |
10 | 18 | |
11 | 19 | test("Basic selector support (.className)", function() { |
12 | | - strictEqual(MFE.utils(".section_heading").length, 2, "only two elements matches this selector"); |
| 20 | + strictEqual(MFE.utils(".t_section_heading").length, 2, "only two elements matches this selector"); |
13 | 21 | }); |
14 | 22 | |
15 | 23 | test("Basic selector support (tag name)", function() { |