From 717108d17f0e601b97a07aa97e42c94380fd3448 Mon Sep 17 00:00:00 2001 From: lilia Date: Sun, 8 Nov 2015 11:01:39 -0800 Subject: [PATCH] Add regression test for #270 // FREEBIE --- test/views/message_view_test.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/views/message_view_test.js b/test/views/message_view_test.js index e1d2c400..9418b83f 100644 --- a/test/views/message_view_test.js +++ b/test/views/message_view_test.js @@ -38,6 +38,12 @@ describe('MessageView', function() { view.render(); assert.match(view.$el.html(), /hour ago/); }); + it('should not imply messages are from the future', function() { + var view = new Whisper.MessageView({model: message}); + message.set({'sent_at': Date.now() + 60000}); + view.render(); + assert.match(view.$el.html(), /seconds ago/); + }); it('should go away when the model is destroyed', function() { var view = new Whisper.MessageView({model: message});