message_list: Add tests for change_message_id.

This commit is contained in:
Cory Lynch 2017-06-07 02:05:30 -04:00 committed by Tim Abbott
parent 6ecd7545ae
commit 863c298d3c
1 changed files with 12 additions and 0 deletions

View File

@ -182,6 +182,18 @@ var MessageList = require('js/message_list').MessageList;
assert.equal(list.nth_most_recent_id(4), -1);
}());
(function test_change_message_id() {
var table;
var filter = {};
var list = new MessageList(table, filter);
list.append([{id: 10.5, content: "good job"}, {id: 20.5, content: "ok!"}]);
list.change_message_id(10.5, 11);
assert.equal(list.get(11).content, "good job");
list.change_message_id(20.5, 10);
assert.equal(list.get(10).content, "ok!");
}());
(function test_local_echo() {
var table;