Skip to content

Commit

Permalink
fix(topic-events): topicEvents.init() test
Browse files Browse the repository at this point in the history
  • Loading branch information
julianlam committed Jan 27, 2021
1 parent dc84559 commit aa8b84b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/topicEvents.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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 () => {
Expand Down

0 comments on commit aa8b84b

Please sign in to comment.