Extract reactions.set_reaction_count.

This commit is contained in:
Steve Howell
2017-05-29 11:24:31 -06:00
committed by Tim Abbott
parent 1747223c35
commit affff8ac82
2 changed files with 19 additions and 4 deletions

View File

@@ -127,6 +127,17 @@ set_global('message_store', {
reactions.message_reaction_on_click(message_id, emoji_name);
}());
(function test_set_reaction_count() {
var count_element = $('count-stub');
var reaction_element = $('reaction-stub');
reaction_element.add_child('.message_reaction_count', count_element);
reactions.set_reaction_count(reaction_element, 5);
assert.equal(count_element.html(), '5');
}());
(function test_add_reaction() {
var event = {
message_id: 1001,
@@ -199,5 +210,6 @@ set_global('message_store', {
reactions.add_reaction(event);
assert(title_set);
assert.equal(count_element.html(), '2');
}());