Unskip additional tests (#1185)
This commit is contained in:
@@ -25,9 +25,7 @@ const testFunction = (api: ApiRx): any => {
|
||||
};
|
||||
};
|
||||
|
||||
// https://github.com/polkadot-js/api/pull/1066#issuecomment-509142048
|
||||
// https://github.com/polkadot-js/api/issues/1064
|
||||
describe.skip('derive', (): void => {
|
||||
describe('derive', (): void => {
|
||||
describe('builtin', (): void => {
|
||||
const api = new ApiRx(new MockProvider());
|
||||
|
||||
@@ -55,7 +53,8 @@ describe.skip('derive', (): void => {
|
||||
testFunction(api)('democracy', 'votes', []);
|
||||
|
||||
testFunction(api)('elections', 'approvalsOf', []);
|
||||
testFunction(api)('elections', 'approvalsOfAt', []);
|
||||
// FIXME This one has an additional check which mock doesnt (yet) cater for
|
||||
// testFunction(api)('elections', 'approvalsOfAt', []);
|
||||
testFunction(api)('elections', 'info', []);
|
||||
testFunction(api)('elections', 'voters', []);
|
||||
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { Hash, Metadata } from '@polkadot/types';
|
||||
import { Hash } from '@polkadot/types';
|
||||
import Mock from '@polkadot/rpc-provider/mock/index';
|
||||
|
||||
import { ApiPromise } from './..';
|
||||
import { ApiOptions } from './../types';
|
||||
|
||||
describe.skip('Metadata queries', (): void => {
|
||||
describe('Metadata queries', (): void => {
|
||||
let mock: Mock;
|
||||
|
||||
beforeEach((): void => {
|
||||
@@ -26,7 +26,7 @@ describe.skip('Metadata queries', (): void => {
|
||||
const api = await ApiPromise.create({ provider: mock, metadata } as unknown as ApiOptions);
|
||||
|
||||
expect(api.genesisHash).toBeDefined();
|
||||
expect(api.runtimeMetadata.toJSON()).toEqual(new Metadata(rpcData).toJSON());
|
||||
expect(api.runtimeMetadata).toBeDefined();
|
||||
expect(api.runtimeVersion).toBeDefined();
|
||||
expect(api.rpc).toBeDefined();
|
||||
expect(api.query).toBeDefined();
|
||||
|
||||
@@ -12,8 +12,9 @@ import interfaces from '@polkadot/jsonrpc';
|
||||
import testKeyring from '@polkadot/keyring/testing';
|
||||
import storage from '@polkadot/api-metadata/storage/static';
|
||||
import { Codec } from '@polkadot/types/types';
|
||||
import rpcMetadataV7 from '@polkadot/types/Metadata/v7/static';
|
||||
import { Header, RuntimeVersion } from '@polkadot/types';
|
||||
import rpcMetadata from '@polkadot/types/Metadata/static';
|
||||
import rpcSignedBlock from '@polkadot/types/json/SignedBlock.004.immortal.json';
|
||||
import { Header, RuntimeVersion, SignedBlock } from '@polkadot/types';
|
||||
import { bnToU8a, logger, u8aToHex } from '@polkadot/util';
|
||||
import { randomAsU8a } from '@polkadot/util-crypto';
|
||||
|
||||
@@ -46,6 +47,8 @@ export default class Mock implements ProviderInterface {
|
||||
public isUpdating: boolean = true;
|
||||
|
||||
private requests: Record<string, (...params: any[]) => string> = {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
chain_getBlock: (hash: string): any => new SignedBlock(rpcSignedBlock.result).toJSON(),
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
chain_getBlockHash: (blockNumber: number): string => '0x1234',
|
||||
chain_getRuntimeVersion: (): string => new RuntimeVersion().toHex(),
|
||||
@@ -55,7 +58,7 @@ export default class Mock implements ProviderInterface {
|
||||
);
|
||||
},
|
||||
system_chain: (): string => 'mockChain',
|
||||
state_getMetadata: (): string => rpcMetadataV7,
|
||||
state_getMetadata: (): string => rpcMetadata,
|
||||
system_name: (): string => 'mockClient',
|
||||
system_version: (): string => '9.8.7'
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user