mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-12-18 03:25:31 -05:00
27 lines
807 B
JavaScript
27 lines
807 B
JavaScript
import AppEvents from 'discourse/lib/app-events';
|
|
import createStore from 'helpers/create-store';
|
|
|
|
export default function(name, opts) {
|
|
opts = opts || {};
|
|
|
|
test(name, function(assert) {
|
|
if (opts.setup) {
|
|
const store = createStore();
|
|
opts.setup.call(this, store);
|
|
}
|
|
const appEvents = AppEvents.create();
|
|
|
|
this.container.register('site-settings:main', Discourse.SiteSettings, { instantiate: false });
|
|
this.container.register('app-events:main', appEvents, { instantiate: false });
|
|
this.container.injection('component', 'siteSettings', 'site-settings:main');
|
|
this.container.injection('component', 'appEvents', 'app-events:main');
|
|
|
|
andThen(() => {
|
|
this.render(opts.template);
|
|
});
|
|
|
|
andThen(() => {
|
|
opts.test.call(this, assert);
|
|
});
|
|
});
|
|
}
|