Fix tests
This commit is contained in:
parent
8a17953468
commit
a2abfe38a4
1 changed files with 3 additions and 3 deletions
|
@ -25,15 +25,15 @@ describe('MessageView', function() {
|
||||||
|
|
||||||
it('should have a nice timestamp', function() {
|
it('should have a nice timestamp', function() {
|
||||||
var view = new Whisper.MessageView({model: message});
|
var view = new Whisper.MessageView({model: message});
|
||||||
message.set({'received_at': new Date().getTime() - 5000});
|
message.set({'sent_at': new Date().getTime() - 5000});
|
||||||
view.render();
|
view.render();
|
||||||
assert.match(view.$el.html(), /seconds ago/);
|
assert.match(view.$el.html(), /seconds ago/);
|
||||||
|
|
||||||
message.set({'received_at': new Date().getTime() - 60000});
|
message.set({'sent_at': new Date().getTime() - 60000});
|
||||||
view.render();
|
view.render();
|
||||||
assert.match(view.$el.html(), /minute ago/);
|
assert.match(view.$el.html(), /minute ago/);
|
||||||
|
|
||||||
message.set({'received_at': new Date().getTime() - 3600000});
|
message.set({'sent_at': new Date().getTime() - 3600000});
|
||||||
view.render();
|
view.render();
|
||||||
assert.match(view.$el.html(), /hour ago/);
|
assert.match(view.$el.html(), /hour ago/);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue