Add test fixtures

Test page loads fixtures and renders the inbox view. This may be useful
for smoke testing style changes or generating screenshots with
pseudo-realistic data.

Includes a couple small changes to get rendering working outside the
app.
This commit is contained in:
lilia 2016-09-22 16:37:12 -07:00
parent 89cd40c1f5
commit b0c59233f3
5 changed files with 3150 additions and 90 deletions

View file

@ -73,7 +73,7 @@
}.bind(this);
this.appWindow.contentWindow.addEventListener('focus', onFocus);
this.appWindow.onClosed.addListener(function () {
extension.windows.onClosed(function () {
this.appWindow.contentWindow.removeEventListener('resize', onResize);
this.appWindow.contentWindow.removeEventListener('focus', onFocus);
window.autosize.destroy(this.$messageField);

View file

@ -13,25 +13,27 @@
},
updateStatus: function() {
var className, message = '';
switch(getSocketStatus && getSocketStatus()) {
case WebSocket.CONNECTING:
className = 'connecting';
break;
case WebSocket.OPEN:
className = 'open';
break;
case WebSocket.CLOSING:
className = 'closing';
break;
case WebSocket.CLOSED:
className = 'closed';
message = i18n('disconnected');
break;
}
if (typeof getSocketStatus === 'function') {
switch(getSocketStatus()) {
case WebSocket.CONNECTING:
className = 'connecting';
break;
case WebSocket.OPEN:
className = 'open';
break;
case WebSocket.CLOSING:
className = 'closing';
break;
case WebSocket.CLOSED:
className = 'closed';
message = i18n('disconnected');
break;
}
if (!this.$el.hasClass(className)) {
this.$el.attr('class', className);
this.$el.text(message);
}
}
}
});