diff --git a/test/channel/voteskip.js b/test/channel/voteskip.js index 02997306..da5f3f81 100644 --- a/test/channel/voteskip.js +++ b/test/channel/voteskip.js @@ -43,12 +43,17 @@ describe('VoteskipModule', () => { } }, playlist: { + _playNext() { + }, + meta: { count: 1 } } }, - users: [fakeUser] + users: [fakeUser], + broadcastAll() { + } }; voteskipModule = new VoteskipModule(fakeChannel); @@ -79,6 +84,20 @@ describe('VoteskipModule', () => { assert(reset, 'Expected voteskip to be reset'); assert(playNext, 'Expected playlist to be advanced'); }); + + it('broadcasts a message', () => { + let sentMessage = false; + fakeChannel.broadcastAll = (frame, data) => { + assert.strictEqual(frame, 'chatMsg'); + assert(/voteskip passed/i.test(data.msg), 'Expected voteskip passed message') + sentMessage = true; + }; + voteskipModule.poll = { + counts: [1] + }; + voteskipModule.update(); + assert(sentMessage, 'Expected voteskip passed message'); + }); }); describe('#calcUsercounts', () => {