https://www.mediawiki.org/wiki/Special:Code/MediaWiki/113897
Revision: 113897
Author: jdlrobson
Date: 2012-03-15 07:56:31 +0000 (Thu, 15 Mar 2012)
Log Message:
-----------
adjust utils tests
there are some side effects with the old tests
sometimes causing them to fail
this makes them past consistently
Modified Paths:
--------------
trunk/extensions/MobileFrontend/tests/js/test_application.js
Modified: trunk/extensions/MobileFrontend/tests/js/test_application.js
===================================================================
--- trunk/extensions/MobileFrontend/tests/js/test_application.js
2012-03-15 07:46:55 UTC (rev 113896)
+++ trunk/extensions/MobileFrontend/tests/js/test_application.js
2012-03-15 07:56:31 UTC (rev 113897)
@@ -1,14 +1,22 @@
var MFE = MobileFrontend;
var MFET = window.MobileFrontendTests;
-module("MobileFrontend application.js: utils");
+module("MobileFrontend application.js: utils", {
+ setup: function() {
+ var section = '<div class="t_section_heading"></div>';
+ $('<div id="mfetest">' + section + '<div id="t_section_1">' +
section + '</div>').appendTo(document.body);
+ },
+ teardown: function() {
+ $("#mfetest").remove();
+ }
+});
test("Basic selector support (#id)", function() {
- strictEqual(MFE.utils("#section_1").length, 1, "only one element
matches this selector");
+ strictEqual(MFE.utils("#t_section_1").length, 1, "only one element
matches this selector");
});
test("Basic selector support (.className)", function() {
- strictEqual(MFE.utils(".section_heading").length, 2, "only two elements
matches this selector");
+ strictEqual(MFE.utils(".t_section_heading").length, 2, "only two
elements matches this selector");
});
test("Basic selector support (tag name)", function() {
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs