mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
fix(topic-events): topicEvents.init() test
This commit is contained in:
@@ -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 () => {
|
||||
|
||||
Reference in New Issue
Block a user