Skip to content
This repository was archived by the owner on Feb 23, 2021. It is now read-only.

Commit 4265af4

Browse files
committed
Remove ipcRender from nav actions
1 parent f547032 commit 4265af4

File tree

3 files changed

+3
-21
lines changed

3 files changed

+3
-21
lines changed

src/action/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ store.init();
2525

2626
export const db = new AppStorage(store, AsyncStorage);
2727
export const log = new LogAction(store, ipcRenderer);
28-
export const nav = new NavAction(store, ipcRenderer);
28+
export const nav = new NavAction(store);
2929
export const grpc = new GrpcAction(store, ipcRenderer);
3030
export const notify = new NotificationAction(store, nav);
3131
export const wallet = new WalletAction(store, grpc, db, nav, notify);

src/action/nav.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
1-
import * as log from './log';
2-
31
class NavAction {
4-
constructor(store, ipcRenderer) {
2+
constructor(store) {
53
this._store = store;
6-
ipcRenderer.on('open-url', (event, arg) => {
7-
// TODO: Go to route
8-
log.info('open-url', arg);
9-
});
104
}
115

126
goLoader() {

test/unit/action/nav.spec.js

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,19 @@ import NavAction from '../../../src/action/nav';
55
describe('Action Nav Unit Tests', () => {
66
let store;
77
let sandbox;
8-
let ipcRenderer;
98
let nav;
109

1110
beforeEach(() => {
1211
sandbox = sinon.createSandbox({});
1312
sandbox.stub(log);
14-
ipcRenderer = {
15-
send: sinon.stub(),
16-
on: sinon.stub().yields('some-event', 'some-arg'),
17-
};
1813
store = new Store();
19-
nav = new NavAction(store, ipcRenderer);
14+
nav = new NavAction(store);
2015
});
2116

2217
afterEach(() => {
2318
sandbox.restore();
2419
});
2520

26-
describe('constructor()', () => {
27-
it('should listen to open-url event', () => {
28-
expect(nav._store, 'to be ok');
29-
expect(ipcRenderer.on, 'was called with', 'open-url');
30-
});
31-
});
32-
3321
describe('goLoader()', () => {
3422
it('should set correct route', () => {
3523
nav.goLoader();

0 commit comments

Comments
 (0)