Fix test
This commit is contained in:
parent
12924b9b5a
commit
13c468c768
|
@ -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', () => {
|
||||
|
|
Loading…
Reference in a new issue