discourse/app/assets/javascripts/wizard/test/helpers/component-test.js

Failed to ignore revisions in .git-blame-ignore-revs.

17 lines
375 B
JavaScript
Raw Normal View History

2018-06-15 23:03:24 +08:00
import initializer from "wizard/initializers/load-helpers";
2016-11-26 03:29:24 +08:00
2016-09-14 03:14:17 +08:00
export function componentTest(name, opts) {
opts = opts || {};
test(name, function(assert) {
2016-11-26 03:29:24 +08:00
initializer.initialize(this.registry);
2016-09-14 03:14:17 +08:00
2017-06-15 01:57:58 +08:00
if (opts.beforeEach) {
opts.beforeEach.call(this);
2016-09-14 03:14:17 +08:00
}
andThen(() => this.render(opts.template));
andThen(() => opts.test.call(this, assert));
});
}