From c44b4762c098d4f9c4d7ef9d93d99abbef87636b Mon Sep 17 00:00:00 2001 From: yashar Date: Wed, 18 Oct 2017 01:00:20 +0330 Subject: [PATCH] Fix a bug in ipcLocale test file --- src/utils/ipcLocale.test.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/utils/ipcLocale.test.js b/src/utils/ipcLocale.test.js index 2dce661fa..85c6d5894 100644 --- a/src/utils/ipcLocale.test.js +++ b/src/utils/ipcLocale.test.js @@ -14,16 +14,19 @@ describe('ipcLocale', () => { }; describe('init', () => { - it('should be a function', () => { - expect(typeof ipcLocale.init).to.be.equal('function'); + beforeEach(() => { + delete window.ipc; }); - it('calling init when ipc is not on window should do nothing', () => { ipcLocale.init(); expect(ipc.on).to.not.have.been.calledWith(); expect(ipc.send).to.not.have.been.calledWith(); }); + it('should be a function', () => { + expect(typeof ipcLocale.init).to.be.equal('function'); + }); + it('calling init when ipc is available on window should bind listeners', () => { window.ipc = ipc; ipcLocale.init(i18n);