Fix NetworkStatusView tests' stubbing of window.i18n
FREEBIE
This commit is contained in:
parent
c77554533c
commit
a9b4109e9b
1 changed files with 6 additions and 6 deletions
|
@ -4,24 +4,24 @@ describe('NetworkStatusView', function() {
|
||||||
var networkStatusView;
|
var networkStatusView;
|
||||||
var socketStatus = WebSocket.OPEN;
|
var socketStatus = WebSocket.OPEN;
|
||||||
|
|
||||||
var oldGetMessage;
|
var oldI18n;
|
||||||
var oldGetSocketStatus;
|
var oldGetSocketStatus;
|
||||||
|
|
||||||
/* BEGIN stubbing globals */
|
/* BEGIN stubbing globals */
|
||||||
before(function() {
|
before(function() {
|
||||||
oldGetSocketStatus = window.getSocketStatus;
|
oldGetSocketStatus = window.getSocketStatus;
|
||||||
/* chrome i18n support is missing in 'regular' webpages */
|
oldI18n = window.i18n;
|
||||||
window.chrome = window.chrome || {};
|
|
||||||
window.chrome.i18n = { getMessage: function(message, args) {
|
|
||||||
// translationMessageName-arg1-arg2
|
// translationMessageName-arg1-arg2
|
||||||
|
window.i18n = function(message, args) {
|
||||||
return _([message, args]).chain().flatten().compact().value().join('-');
|
return _([message, args]).chain().flatten().compact().value().join('-');
|
||||||
}
|
|
||||||
};
|
};
|
||||||
window.getSocketStatus = function() { return socketStatus; };
|
window.getSocketStatus = function() { return socketStatus; };
|
||||||
});
|
});
|
||||||
|
|
||||||
after(function() {
|
after(function() {
|
||||||
window.getSocketStatus = oldGetSocketStatus;
|
window.getSocketStatus = oldGetSocketStatus;
|
||||||
|
window.i18n = oldI18n;
|
||||||
});
|
});
|
||||||
/* END stubbing globals */
|
/* END stubbing globals */
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue