Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
RocketChat
Rocket.Chat.js.SDK
Commits
be6855e3
Commit
be6855e3
authored
Jun 27, 2018
by
Tim Kinnane
Browse files
fix(setReaction): Replace test emoji with argument
parent
709ad28d
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
coverage/lcov.info
View file @
be6855e3
...
...
@@ -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:3
1
BRH:3
2
end_of_record
dist/lib/Driver.js
View file @
be6855e3
...
...
@@ -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
dist/lib/Driver.js.map
View file @
be6855e3
This diff is collapsed.
Click to expand it.
src/lib/driver.spec.ts
View file @
be6855e3
...
...
@@ -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
'
)
})
...
...
src/lib/driver.ts
View file @
be6855e3
...
...
@@ -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
])
}
Git Mirror User
@gitmirror
mentioned in commit
70e22fc0
·
Oct 21, 2018
mentioned in commit
70e22fc0
mentioned in commit 70e22fc01e8f74c9adf443551614d0bbde58f320
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment