fix(topic-events): topicEvents.init() test

v1.18.x
Julian Lam 4 years ago
parent dc84559d0b
commit aa8b84bb56

@ -28,6 +28,10 @@ describe('Topic Events', () => {
});
describe('.init()', () => {
before(() => {
topics.events._ready = false;
});
it('should allow a plugin to expose new event types', async () => {
await plugins.hooks.register('core', {
hook: 'filter:topicEvents.init',
@ -45,6 +49,11 @@ describe('Topic Events', () => {
await topics.events.init();
assert(topics.events._types.foo);
assert.deepStrictEqual(topics.events._types.foo, {
icon: 'bar',
text: 'baz',
quux: 'quux',
});
});
it('should do nothing if called a second time', async () => {

Loading…
Cancel
Save