Fix the build

1. Update chrome version because v40 fails to clear the session store
2. Add message view to test page and fix bad reference to chrome
3. Update the message view template in tests with new timestmap markup

// FREEBIE
This commit is contained in:
lilia 2015-11-08 00:15:14 -08:00
parent d607996cf8
commit 038e263023
4 changed files with 16 additions and 11 deletions

View file

@ -176,7 +176,7 @@ module.exports = function(grunt) {
],
build: process.env.TRAVIS_JOB_ID,
browsers: [
{ browserName: 'chrome', version: '40' },
{ browserName: 'chrome', version: '41' },
{ platform: 'linux', browserName: 'firefox', version: '34' }
],
testname: 'TextSecure-Browser Tests',

View file

@ -124,7 +124,11 @@
},
onClosed: function(callback) {
// assumes only one front end window
return chrome.app.window.getAll()[0].onClosed.addListener(callback);
if (window.chrome && chrome.app && chrome.app.window) {
return chrome.app.window.getAll()[0].onClosed.addListener(callback);
} else {
window.addEventListener('beforeunload', callback);
}
},
drawAttention: function(window_id) {

View file

@ -31,14 +31,14 @@
</div>
</script>
<script type='text/x-tmpl-mustache' id='message'>
<div class='sender'>{{ sender }}</div>
<img class='avatar' src='{{ contact_avatar }}'>
{{> avatar }}
<div class="bubble">
<p class="content">{{ message }}</p>
<div class='sender'>{{ sender }}</div>
<div class='attachments'></div>
<p class="content">{{ message }}</p>
<div class='meta'>
<span class='timestamp'>{{ timestamp }}</span>
<span class='checkmark hide'></span>
<span class='timestamp' data-timestamp={{ timestamp }}></span>
<span class='status hide'></span>
</div>
</div>
</script>
@ -118,6 +118,7 @@
<script type="text/javascript" src="../js/views/list_view.js" data-cover></script>
<script type="text/javascript" src="../js/views/group_update_view.js"></script>
<script type="text/javascript" src="../js/views/attachment_view.js"></script>
<script type="text/javascript" src="../js/views/timestamp_view.js" data-cover></script>
<script type="text/javascript" src="../js/views/message_view.js" data-cover></script>
<script type="text/javascript" src="../js/views/message_list_view.js" data-cover></script>
<script type="text/javascript" src="../js/views/conversation_list_item_view.js" data-cover></script>

View file

@ -10,7 +10,7 @@ describe('MessageView', function() {
body: 'hello world',
type: 'outgoing',
source: '+14158675309',
received_at: new Date().getTime()
received_at: Date.now()
});
it('should display the message text', function() {
@ -26,15 +26,15 @@ describe('MessageView', function() {
it('should have a nice timestamp', function() {
var view = new Whisper.MessageView({model: message});
message.set({'sent_at': new Date().getTime() - 5000});
message.set({'sent_at': Date.now() - 5000});
view.render();
assert.match(view.$el.html(), /seconds ago/);
message.set({'sent_at': new Date().getTime() - 60000});
message.set({'sent_at': Date.now() - 60000});
view.render();
assert.match(view.$el.html(), /minute ago/);
message.set({'sent_at': new Date().getTime() - 3600000});
message.set({'sent_at': Date.now() - 3600000});
view.render();
assert.match(view.$el.html(), /hour ago/);
});