enhances integration test helper with the ability to invoke additional setup / teardown code
This commit is contained in:
parent
8724b2e2b6
commit
1dcd2d903b
|
@ -1,12 +1,20 @@
|
||||||
function integration(name) {
|
function integration(name, lifecycle) {
|
||||||
module("Integration: " + name, {
|
module("Integration: " + name, {
|
||||||
setup: function() {
|
setup: function() {
|
||||||
sinon.stub(Discourse.ScrollingDOMMethods, "bindOnScroll");
|
sinon.stub(Discourse.ScrollingDOMMethods, "bindOnScroll");
|
||||||
sinon.stub(Discourse.ScrollingDOMMethods, "unbindOnScroll");
|
sinon.stub(Discourse.ScrollingDOMMethods, "unbindOnScroll");
|
||||||
Ember.run(Discourse, Discourse.advanceReadiness);
|
Ember.run(Discourse, Discourse.advanceReadiness);
|
||||||
|
|
||||||
|
if (lifecycle && lifecycle.setup) {
|
||||||
|
lifecycle.setup.call(this);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
teardown: function() {
|
teardown: function() {
|
||||||
|
if (lifecycle && lifecycle.teardown) {
|
||||||
|
lifecycle.teardown.call(this);
|
||||||
|
}
|
||||||
|
|
||||||
Discourse.reset();
|
Discourse.reset();
|
||||||
Discourse.ScrollingDOMMethods.bindOnScroll.restore();
|
Discourse.ScrollingDOMMethods.bindOnScroll.restore();
|
||||||
Discourse.ScrollingDOMMethods.unbindOnScroll.restore();
|
Discourse.ScrollingDOMMethods.unbindOnScroll.restore();
|
||||||
|
|
Loading…
Reference in New Issue