mirror of https://github.com/calzoneman/sync.git
Fix test
This commit is contained in:
parent
12924b9b5a
commit
13c468c768
|
@ -43,12 +43,17 @@ describe('VoteskipModule', () => {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
playlist: {
|
playlist: {
|
||||||
|
_playNext() {
|
||||||
|
},
|
||||||
|
|
||||||
meta: {
|
meta: {
|
||||||
count: 1
|
count: 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
users: [fakeUser]
|
users: [fakeUser],
|
||||||
|
broadcastAll() {
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
voteskipModule = new VoteskipModule(fakeChannel);
|
voteskipModule = new VoteskipModule(fakeChannel);
|
||||||
|
@ -79,6 +84,20 @@ describe('VoteskipModule', () => {
|
||||||
assert(reset, 'Expected voteskip to be reset');
|
assert(reset, 'Expected voteskip to be reset');
|
||||||
assert(playNext, 'Expected playlist to be advanced');
|
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', () => {
|
describe('#calcUsercounts', () => {
|
||||||
|
|
Loading…
Reference in New Issue