2016-09-13 15:14:17 -04:00
|
|
|
import initializer from "wizard/initializers/load-helpers";
|
2020-10-06 12:54:05 -04:00
|
|
|
import { test } from "qunit";
|
2016-11-25 14:29:24 -05:00
|
|
|
|
2016-09-13 15:14:17 -04:00
|
|
|
export function componentTest(name, opts) {
|
|
|
|
opts = opts || {};
|
|
|
|
|
|
|
|
test(name, function (assert) {
|
2016-11-25 14:29:24 -05:00
|
|
|
initializer.initialize(this.registry);
|
2016-09-13 15:14:17 -04:00
|
|
|
|
2017-06-14 13:57:58 -04:00
|
|
|
if (opts.beforeEach) {
|
|
|
|
opts.beforeEach.call(this);
|
2016-09-13 15:14:17 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
andThen(() => this.render(opts.template));
|
|
|
|
andThen(() => opts.test.call(this, assert));
|
|
|
|
});
|
|
|
|
}
|