Skip to content
This repository has been archived by the owner on Apr 15, 2019. It is now read-only.

Commit

Permalink
Fix a bug in ipcLocale test file
Browse files Browse the repository at this point in the history
  • Loading branch information
yasharAyari committed Oct 17, 2017
1 parent e8d0f05 commit c44b476
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/utils/ipcLocale.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit c44b476

Please sign in to comment.