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:
parent
d607996cf8
commit
038e263023
4 changed files with 16 additions and 11 deletions
|
@ -176,7 +176,7 @@ module.exports = function(grunt) {
|
||||||
],
|
],
|
||||||
build: process.env.TRAVIS_JOB_ID,
|
build: process.env.TRAVIS_JOB_ID,
|
||||||
browsers: [
|
browsers: [
|
||||||
{ browserName: 'chrome', version: '40' },
|
{ browserName: 'chrome', version: '41' },
|
||||||
{ platform: 'linux', browserName: 'firefox', version: '34' }
|
{ platform: 'linux', browserName: 'firefox', version: '34' }
|
||||||
],
|
],
|
||||||
testname: 'TextSecure-Browser Tests',
|
testname: 'TextSecure-Browser Tests',
|
||||||
|
|
|
@ -124,7 +124,11 @@
|
||||||
},
|
},
|
||||||
onClosed: function(callback) {
|
onClosed: function(callback) {
|
||||||
// assumes only one front end window
|
// 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) {
|
drawAttention: function(window_id) {
|
||||||
|
|
|
@ -31,14 +31,14 @@
|
||||||
</div>
|
</div>
|
||||||
</script>
|
</script>
|
||||||
<script type='text/x-tmpl-mustache' id='message'>
|
<script type='text/x-tmpl-mustache' id='message'>
|
||||||
<div class='sender'>{{ sender }}</div>
|
{{> avatar }}
|
||||||
<img class='avatar' src='{{ contact_avatar }}'>
|
|
||||||
<div class="bubble">
|
<div class="bubble">
|
||||||
<p class="content">{{ message }}</p>
|
<div class='sender'>{{ sender }}</div>
|
||||||
<div class='attachments'></div>
|
<div class='attachments'></div>
|
||||||
|
<p class="content">{{ message }}</p>
|
||||||
<div class='meta'>
|
<div class='meta'>
|
||||||
<span class='timestamp'>{{ timestamp }}</span>
|
<span class='timestamp' data-timestamp={{ timestamp }}></span>
|
||||||
<span class='checkmark hide'>✓</span>
|
<span class='status hide'></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</script>
|
</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/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/group_update_view.js"></script>
|
||||||
<script type="text/javascript" src="../js/views/attachment_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_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/message_list_view.js" data-cover></script>
|
||||||
<script type="text/javascript" src="../js/views/conversation_list_item_view.js" data-cover></script>
|
<script type="text/javascript" src="../js/views/conversation_list_item_view.js" data-cover></script>
|
||||||
|
|
|
@ -10,7 +10,7 @@ describe('MessageView', function() {
|
||||||
body: 'hello world',
|
body: 'hello world',
|
||||||
type: 'outgoing',
|
type: 'outgoing',
|
||||||
source: '+14158675309',
|
source: '+14158675309',
|
||||||
received_at: new Date().getTime()
|
received_at: Date.now()
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should display the message text', function() {
|
it('should display the message text', function() {
|
||||||
|
@ -26,15 +26,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({'sent_at': new Date().getTime() - 5000});
|
message.set({'sent_at': Date.now() - 5000});
|
||||||
view.render();
|
view.render();
|
||||||
assert.match(view.$el.html(), /seconds ago/);
|
assert.match(view.$el.html(), /seconds ago/);
|
||||||
|
|
||||||
message.set({'sent_at': new Date().getTime() - 60000});
|
message.set({'sent_at': Date.now() - 60000});
|
||||||
view.render();
|
view.render();
|
||||||
assert.match(view.$el.html(), /minute ago/);
|
assert.match(view.$el.html(), /minute ago/);
|
||||||
|
|
||||||
message.set({'sent_at': new Date().getTime() - 3600000});
|
message.set({'sent_at': Date.now() - 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