diff --git a/tests/bridge-sdk/__snapshots__/kusama.test.ts.snap b/tests/bridge-sdk/__snapshots__/kusama.test.ts.snap index f812651..91c109a 100644 --- a/tests/bridge-sdk/__snapshots__/kusama.test.ts.snap +++ b/tests/bridge-sdk/__snapshots__/kusama.test.ts.snap @@ -165,11 +165,11 @@ exports[`'karura' to 'bifrost' using bridgeSDK cross-chain 'KUSD' > Cross-chain "address": "5FA9nQDVg267DEd8m1ZypXLBnvN7SFxYwV7ndqSYGiN9TTpu", "decimals": 12, "fromChain": 8, - "toChain": "(rounded 1.84)", + "toChain": "(rounded 1.9)", } `; -exports[`'karura' to 'bifrost' using bridgeSDK cross-chain 'KUSD' > Cross-chain using BridgeSDK works > fee 1`] = `"(rounded 0.2)"`; +exports[`'karura' to 'bifrost' using bridgeSDK cross-chain 'KUSD' > Cross-chain using BridgeSDK works > fee 1`] = `"(rounded 0.1)"`; exports[`'karura' to 'bifrost' using bridgeSDK cross-chain 'KUSD' > Cross-chain using BridgeSDK works > initial 1`] = ` { diff --git a/tests/bridge-sdk/kusama.test.ts b/tests/bridge-sdk/kusama.test.ts index eb257fa..9f226bf 100644 --- a/tests/bridge-sdk/kusama.test.ts +++ b/tests/bridge-sdk/kusama.test.ts @@ -61,6 +61,7 @@ const tests = [ from: 'karura', to: 'bifrost', token: 'KUSD', + precision: 2, }, { from: 'bifrost', diff --git a/tests/bridge-sdk/shared.ts b/tests/bridge-sdk/shared.ts index ec250a4..83d384d 100644 --- a/tests/bridge-sdk/shared.ts +++ b/tests/bridge-sdk/shared.ts @@ -27,10 +27,11 @@ export type TestTtype = { to: NetworkNames token: string ignoreFee?: boolean + precision?: number } export const buildTests = (tests: ReadonlyArray) => { - for (const { from, to, token, ignoreFee } of tests) { + for (const { from, to, token, ignoreFee, precision } of tests) { describe(`'${from}' to '${to}' using bridgeSDK cross-chain '${token}'`, async () => { let fromchain: Network let tochain: Network @@ -173,7 +174,9 @@ export const buildTests = (tests: ReadonlyArray) => { await sleep(100) const chainBalanceNow = await chainBalance(sdk, fromData, address) - await check(chainBalanceNow).redact({ number: 3 }).toMatchSnapshot('after') + await check(chainBalanceNow) + .redact({ number: precision ?? 3 }) + .toMatchSnapshot('after') //Verify if Destination Chain Transfer Fee matches the app expect(chainBalanceNow.fromChain).not.toEqual(chainBalanceInitial.fromChain)