Cleanup dropEmbedded tests to not need teardown
Instead, by inserting stuff into the div#mock, it'll be all cleaned up
by the global teardown
diff --git a/test/unit/publicapi.test.js b/test/unit/publicapi.test.js
index f3d621d..4395cc8 100644
--- a/test/unit/publicapi.test.js
+++ b/test/unit/publicapi.test.js
@@ -811,7 +811,7 @@
// Test that we use clientY instead of pageY
var windowHeight = $(window).height();
var filler = $('<div>').height(windowHeight);
- filler.insertBefore('#mock');
+ filler.prependTo('#mock');
var mq = MQ.MathField($('<span>').appendTo('#mock')[0]);
mq.typedText("mmmm/mmmm");
@@ -827,15 +827,13 @@
assert.equal(document.activeElement, $(mq.el()).find('textarea')[0]);
assert.equal(mq.latex(), "\\frac{mmmm}{mmxmm}");
-
- filler.remove();
});
test('target is optional', function() {
// Insert filler so that the page is taller than the window so this test is deterministic
// Test that we use clientY instead of pageY
var windowHeight = $(window).height();
var filler = $('<div>').height(windowHeight);
- filler.insertBefore('#mock');
+ filler.prependTo('#mock');
var mq = MQ.MathField($('<span>').appendTo('#mock')[0]);
mq.typedText("mmmm/mmmm");
@@ -850,8 +848,6 @@
assert.equal(document.activeElement, $(mq.el()).find('textarea')[0]);
assert.equal(mq.latex(), "\\frac{mmmm}{mmxmm}");
-
- filler.remove();
});
});
@@ -873,7 +869,7 @@
// Test that we use clientY instead of pageY
var windowHeight = $(window).height();
var filler = $('<div>').height(windowHeight);
- filler.insertBefore('#mock');
+ filler.prependTo('#mock');
var mq = MQ.MathField($('<span>').appendTo('#mock')[0]);
mq.typedText("mmmm/mmmm");
@@ -892,8 +888,6 @@
assert.ok(jQuery('.embedded-html').length);
assert.equal(mq.text(), "(m*m*m*m)/(m*m*embedded text*m*m)");
assert.equal(mq.latex(), "\\frac{mmmm}{mmembedded latexmm}");
-
- filler.remove();
});
});