This commit is contained in:
Calvin Montgomery 2019-03-27 21:37:57 -07:00
parent 12924b9b5a
commit 13c468c768

View file

@ -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', () => {