fix JS tests

This commit is contained in:
maciejhirsz 2017-06-12 16:44:59 +02:00
parent edea41d35e
commit 41df8413fc
3 changed files with 35 additions and 2 deletions

View File

@ -60,6 +60,11 @@ function createRedux () {
},
balances: {
balances: {}
},
nodeStatus: {
nodeKind: {
'availability': 'personal'
}
}
};
}

View File

@ -33,6 +33,11 @@ function createStore () {
views: {
settings: { fixed: true }
}
},
nodeStatus: {
nodeKind: {
'availability': 'personal'
}
}
};
}

View File

@ -25,6 +25,25 @@ const TEST_APP_HISTORY = [];
let api;
let component;
let instance;
let store;
function createStore () {
store = {
dispatch: sinon.stub(),
subscribe: sinon.stub(),
getState: () => {
return {
nodeStatus: {
nodeKind: {
'availability': 'personal'
}
}
};
}
};
return store;
}
function createApi () {
api = {
@ -40,11 +59,15 @@ function render () {
component = shallow(
<Home />,
{
context: {
store: createStore()
}
}
).find('Home').shallow({
context: {
api: createApi()
}
}
);
});
instance = component.instance();
return component;