From a9b4109e9be1d9e26a30d4aa060db90cda5e5543 Mon Sep 17 00:00:00 2001 From: Scott Nonnenberg Date: Thu, 11 May 2017 17:01:49 -0700 Subject: [PATCH] Fix NetworkStatusView tests' stubbing of window.i18n FREEBIE --- test/views/network_status_view_test.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/views/network_status_view_test.js b/test/views/network_status_view_test.js index 17879ba1e..59ee678d8 100644 --- a/test/views/network_status_view_test.js +++ b/test/views/network_status_view_test.js @@ -4,24 +4,24 @@ describe('NetworkStatusView', function() { var networkStatusView; var socketStatus = WebSocket.OPEN; - var oldGetMessage; + var oldI18n; var oldGetSocketStatus; /* BEGIN stubbing globals */ before(function() { oldGetSocketStatus = window.getSocketStatus; - /* chrome i18n support is missing in 'regular' webpages */ - window.chrome = window.chrome || {}; - window.chrome.i18n = { getMessage: function(message, args) { - // translationMessageName-arg1-arg2 + oldI18n = window.i18n; + + // translationMessageName-arg1-arg2 + window.i18n = function(message, args) { return _([message, args]).chain().flatten().compact().value().join('-'); - } }; window.getSocketStatus = function() { return socketStatus; }; }); after(function() { window.getSocketStatus = oldGetSocketStatus; + window.i18n = oldI18n; }); /* END stubbing globals */