Adjust test expectations (#5490)

This commit is contained in:
Jaco
2023-02-16 21:10:17 +02:00
committed by GitHub
parent 5cbe80066d
commit b8233fb7b8
10 changed files with 30 additions and 22 deletions
@@ -13,8 +13,15 @@ describe('SystemInherentData', (): void => {
it('can decode Kilt', (): void => {
const value = registry.createType('SystemInherentData', KILT);
console.log(JSON.stringify(value.toHuman(), null, 2));
// console.log(JSON.stringify(value.toHuman(), null, 2));
expect(value).toBeTruthy();
expect(value.toHuman()).toMatchObject({
validationData: {
maxPovSize: '0',
parentHead: '0xd51627af4cb8414b6ad454e7204424e7e8489738c5fabe20cee3256bd69b7534d12b2798b04e574d05fb8a4b163745b1e610fb75de59399271bd57e49738506a7a93ee0038dd6a1b3bfbb58f747a7b2052058620839a8e2d03f5a43b48ca6000c66a00',
relayParentNumber: '38,441',
relayParentStorageRoot: '0x4412f5d19eed1a0cbafadd3b050b6e87fbcdff0a4b2ab0dce498d2180f7d7fe4'
}
});
});
});
@@ -55,7 +55,7 @@ describe('extrinsics', (): void => {
describe('decorateExtrinsics', (): void => {
it('should throw if an incorrect number of args is supplied', (): void => {
expect(() => extrinsics.balances.setBalance()).toThrowError(/expects 3 arguments/);
expect(() => extrinsics.balances.setBalance()).toThrow(/expects 3 arguments/);
});
it('should return a value if the storage function does not expect an argument', (): void => {
@@ -21,15 +21,15 @@ describe('decorateStorage', (): void => {
const query = decorateStorage(registry, metadata.asLatest, metadata.version);
it('should throw if the storage function expects an argument', (): void => {
expect(() => query.balances.account()).toThrowError('Call to balances.account needs 1 arguments, found []');
expect(() => query.balances.account()).toThrow('Call to balances.account needs 1 arguments, found []');
});
it('should throw if the storage function expects multiple arguments', (): void => {
expect(() => query.staking.erasStakers([1])).toThrowError('Call to staking.erasStakers needs 2 arguments, found [1]');
expect(() => query.staking.erasStakers([1])).toThrow('Call to staking.erasStakers needs 2 arguments, found [1]');
});
it('should throw if the storage function expects tuple arguments', (): void => {
expect(() => query.staking.erasStakers(1)).toThrowError('Call to staking.erasStakers needs 2 arguments');
expect(() => query.staking.erasStakers(1)).toThrow('Call to staking.erasStakers needs 2 arguments, found [1]');
});
it('should return a value if the storage function does not expect an argument', (): void => {