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: {
balances: {} balances: {}
},
nodeStatus: {
nodeKind: {
'availability': 'personal'
}
} }
}; };
} }

View File

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

View File

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