mirror of
https://github.com/pezkuwichain/pezkuwi-ui.git
synced 2026-05-01 05:27:58 +00:00
9ce16e99bc
* Add ui-util formatting & util * Update README
25 lines
1012 B
TypeScript
25 lines
1012 B
TypeScript
// Copyright 2017-2019 @polkadot/ui-util authors & contributors
|
|
// This software may be modified and distributed under the terms
|
|
// of the Apache-2.0 license. See the LICENSE file for details.
|
|
|
|
import isTestChain from './isTestChain';
|
|
|
|
describe('isTestChain', () => {
|
|
it('enables test environment when chain specification matches text of dev or loc(al)', () => {
|
|
const validTestModeChainSpecsWithDev = ['Development'];
|
|
const validTestModeChainSpecsWithLoc = ['Local Testnet'];
|
|
|
|
validTestModeChainSpecsWithDev.concat(validTestModeChainSpecsWithLoc).forEach((s) =>
|
|
expect(isTestChain(s)).toEqual(true)
|
|
);
|
|
});
|
|
|
|
it('disables keyring test mode when chain specification is not a test mode or undefined or number type', () => {
|
|
const invalidTestModeChainSpecs = ['dev', 'local', 'development', 'PoC-1 Testnet', 'Staging Testnet', 'future PoC-2 Testnet', 'a pocadot?', undefined];
|
|
|
|
invalidTestModeChainSpecs.forEach((s) =>
|
|
expect(isTestChain(s)).toEqual(false)
|
|
);
|
|
});
|
|
});
|