From 91441bade6b43c70462023c22a49ac495b90cf6e Mon Sep 17 00:00:00 2001 From: Mario J Maurello Date: Tue, 27 Aug 2024 01:56:45 +0200 Subject: [PATCH] adjust tests --- .../src/balance/BalanceBuilder.test.ts | 30 +++++++++++++++++-- .../__snapshots__/BalanceBuilder.test.ts.snap | 2 ++ 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/packages/builder/src/balance/BalanceBuilder.test.ts b/packages/builder/src/balance/BalanceBuilder.test.ts index 55557134..6f53fa01 100644 --- a/packages/builder/src/balance/BalanceBuilder.test.ts +++ b/packages/builder/src/balance/BalanceBuilder.test.ts @@ -54,7 +54,23 @@ describe('balanceBuilder', () => { it('should transform correctly with frozen balance', async () => { await expect( config.transform({ - data: { free: balanceOf(999), frozen: balanceOf(99) }, + data: { + free: balanceOf(999), + frozen: balanceOf(99), + reserved: balanceOf(0), + }, + }), + ).resolves.toMatchSnapshot(); + }); + + it('should transform correctly with reserved balance', async () => { + await expect( + config.transform({ + data: { + free: balanceOf(999), + frozen: balanceOf(99), + reserved: balanceOf(99), + }, }), ).resolves.toMatchSnapshot(); }); @@ -62,7 +78,11 @@ describe('balanceBuilder', () => { it('should transform correctly with miscFrozen balance', async () => { await expect( config.transform({ - data: { free: balanceOf(999), miscFrozen: balanceOf(99) }, + data: { + free: balanceOf(999), + miscFrozen: balanceOf(99), + reserved: balanceOf(0), + }, }), ).resolves.toMatchSnapshot(); }); @@ -164,7 +184,11 @@ describe('balanceBuilder', () => { it('should transform correctly', async () => { await expect( - config.transform({ free: balanceOf(999), frozen: balanceOf(99) }), + config.transform({ + free: balanceOf(999), + frozen: balanceOf(99), + reserved: balanceOf(0), + }), ).resolves.toMatchSnapshot(); }); }); diff --git a/packages/builder/src/balance/__snapshots__/BalanceBuilder.test.ts.snap b/packages/builder/src/balance/__snapshots__/BalanceBuilder.test.ts.snap index 27ca6e00..2369c5e0 100644 --- a/packages/builder/src/balance/__snapshots__/BalanceBuilder.test.ts.snap +++ b/packages/builder/src/balance/__snapshots__/BalanceBuilder.test.ts.snap @@ -31,6 +31,8 @@ exports[`balanceBuilder > system > account > should transform correctly with fro exports[`balanceBuilder > system > account > should transform correctly with miscFrozen balance 1`] = `900n`; +exports[`balanceBuilder > system > account > should transform correctly with reserved balance 1`] = `999n`; + exports[`balanceBuilder > system > accountEquilibrium > should be correct config 1`] = ` SubstrateQueryConfig { "args": [