diff --git a/converse.js b/converse.js index de80d028a..8a920b345 100644 --- a/converse.js +++ b/converse.js @@ -229,6 +229,12 @@ chats.splice(_.indexOf(chats, jid), 1); } store.set(key, chats); + }, + + flush: function () { + // Clears all localstorage content handled by burry.js + // Only used in tests + store.flush(); } }); @@ -370,8 +376,6 @@ $content = this.$el.find('.chat-content'), prev_date, this_date, now, separator, i; - - for (i=0; i<_.size(msgs); i++) { var msg = msgs[i], msg_array = msg.split(' ', 2), @@ -1822,5 +1826,7 @@ } }, this)); }, xmppchat)); + + return xmppchat; })); diff --git a/tests.html b/tests.html new file mode 100644 index 000000000..146ac0d7a --- /dev/null +++ b/tests.html @@ -0,0 +1,18 @@ + + +
+