Commit be6855e3 authored by Tim Kinnane's avatar Tim Kinnane

fix(setReaction): Replace test emoji with argument

parent 709ad28d
......@@ -754,7 +754,7 @@ DA:30,9
LF:17
LH:17
BRDA:3,0,0,9
BRDA:3,0,1,0
BRDA:3,0,1,9
BRDA:4,1,0,9
BRDA:4,1,1,9
BRDA:8,2,0,9
......@@ -788,5 +788,5 @@ BRDA:29,15,1,9
BRDA:30,16,0,9
BRDA:30,16,1,9
BRF:34
BRH:31
BRH:32
end_of_record
......@@ -564,7 +564,7 @@ exports.editMessage = editMessage;
* @param messageId ID for a previously sent message
*/
function setReaction(emoji, messageId) {
return asyncCall('setReaction', [':punch:', messageId]);
return asyncCall('setReaction', [emoji, messageId]);
}
exports.setReaction = setReaction;
//# sourceMappingURL=driver.js.map
\ No newline at end of file
This diff is collapsed.
......@@ -162,7 +162,7 @@ describe('driver', () => {
const message = driver.prepareMessage({
msg: ':point_down:',
emoji: ':point_right:',
reactions: { ':punch:': { usernames: [botUser.username] } },
reactions: { ':thumbsup:': { usernames: [botUser.username] } },
groupable: false,
rid: tId
})
......@@ -207,19 +207,19 @@ describe('driver', () => {
it('adds emoji reaction to message', async () => {
let sent = await driver.sendToRoomId('test reactions', tId)
if (Array.isArray(sent)) sent = sent[0] // see todo on `sendToRoomId`
const reaction = await driver.setReaction(':punch:', sent._id)
await driver.setReaction(':thumbsup:', sent._id)
const last = (await utils.lastMessages(tId))[0]
expect(last.reactions).to.have.deep.property(':punch:', {
expect(last.reactions).to.have.deep.property(':thumbsup:', {
usernames: [ botUser.username ]
})
})
it('removes if used when emoji reaction exists', async () => {
const sent = await driver.sendMessage(driver.prepareMessage({
msg: 'test reactions -',
reactions: { ':punch:': { usernames: [botUser.username] } },
reactions: { ':thumbsup:': { usernames: [botUser.username] } },
rid: tId
}))
const reaction = await driver.setReaction(':punch:', sent._id)
await driver.setReaction(':thumbsup:', sent._id)
const last = (await utils.lastMessages(tId))[0]
expect(last).to.not.have.property('reactions')
})
......
......@@ -592,5 +592,5 @@ export function editMessage (message: IMessage): Promise<IMessage> {
* @param messageId ID for a previously sent message
*/
export function setReaction (emoji: string, messageId: string) {
return asyncCall('setReaction', [':punch:', messageId])
return asyncCall('setReaction', [emoji, messageId])
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment