Merge pull request #5822 from paritytech/fix-tests

Fix JS tests
This commit is contained in:
Maciej Hirsz 2017-06-12 18:12:13 +02:00 committed by GitHub
commit c768c302da
5 changed files with 38 additions and 3 deletions

View File

@ -32,7 +32,8 @@ class MockedTransport extends JsonRpcBase {
} }
} }
describe('api/local/LocalAccountsMiddleware', function () { // Skip till all CI runs on Node 8+
describe.skip('api/local/LocalAccountsMiddleware', function () {
this.timeout(30000); this.timeout(30000);
let transport; let transport;

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 = {
@ -40,11 +59,15 @@ function render () {
component = shallow( component = shallow(
<Home />, <Home />,
{ {
context: {
store: createStore()
}
}
).find('Home').shallow({
context: { context: {
api: createApi() api: createApi()
} }
} });
);
instance = component.instance(); instance = component.instance();
return component; return component;

View File

@ -1248,6 +1248,7 @@ mod tests {
hosts: Some(vec![]), hosts: Some(vec![]),
signer_path: expected.into(), signer_path: expected.into(),
ui_address: Some(("127.0.0.1".to_owned(), 8180)), ui_address: Some(("127.0.0.1".to_owned(), 8180)),
support_token_api: true
}, UiConfiguration { }, UiConfiguration {
enabled: true, enabled: true,
interface: "127.0.0.1".into(), interface: "127.0.0.1".into(),