mirror of
https://github.com/status-im/MyCrypto.git
synced 2025-01-10 19:16:10 +00:00
ecccdcfc33
* Replace custom linter rule with no-http-string rule. Fix exceptions. * Replaced all http links in translations with https links.
39 lines
1.0 KiB
TypeScript
39 lines
1.0 KiB
TypeScript
import {
|
|
makeCustomNodeId,
|
|
getCustomNodeConfigFromId,
|
|
getNodeConfigFromId,
|
|
makeNodeConfigFromCustomConfig
|
|
} from 'utils/node';
|
|
|
|
const custNode = {
|
|
name: 'Test Config',
|
|
url: 'https://somecustomconfig.org/',
|
|
port: 443,
|
|
network: 'ETH'
|
|
};
|
|
const custNodeId = 'https://somecustomconfig.org/:443';
|
|
|
|
describe('makeCustomNodeId', () => {
|
|
it('should construct an ID from url:port', () => {
|
|
expect(makeCustomNodeId(custNode) === custNodeId).toBeTruthy();
|
|
});
|
|
});
|
|
|
|
describe('getCustomNodeConfigFromId', () => {
|
|
it('should fetch the correct config, given its ID', () => {
|
|
expect(getCustomNodeConfigFromId(custNodeId, [custNode])).toBeTruthy();
|
|
});
|
|
});
|
|
|
|
describe('getNodeConfigFromId', () => {
|
|
it('should fetch the correct config, given its ID', () => {
|
|
expect(getNodeConfigFromId(custNodeId, [custNode])).toBeTruthy();
|
|
});
|
|
});
|
|
|
|
describe('makeNodeConfigFromCustomConfig', () => {
|
|
it('Should create a node config from a custom config', () => {
|
|
expect(makeNodeConfigFromCustomConfig(custNode)).toBeTruthy();
|
|
});
|
|
});
|