From 7e1e77af13be020a812959528b5b9ea9b989aac1 Mon Sep 17 00:00:00 2001 From: Jude Nullon Date: Fri, 22 May 2026 14:13:55 +0100 Subject: [PATCH 1/2] fix: garden test --- shared/tests/integration-vi/garden-transfer.test.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/shared/tests/integration-vi/garden-transfer.test.ts b/shared/tests/integration-vi/garden-transfer.test.ts index f4ed726d..5fe4e74d 100644 --- a/shared/tests/integration-vi/garden-transfer.test.ts +++ b/shared/tests/integration-vi/garden-transfer.test.ts @@ -18,7 +18,10 @@ const storage: IStorage = { const BTC_ASSET: AssetId = 'native:bitcoin'; const BOTANIX_ASSET: AssetId = 'native:botanix'; -const isInsufficientLiquidity = (err: unknown): boolean => err instanceof GardenApiError && /insufficient liquidity/i.test(err.message); +// Garden pairs come and go: a pair may have no liquidity, no solver route, or +// reference an asset Garden doesn't list. All mean "try the next candidate / +// skip" rather than fail — only genuine client/auth errors should throw. +const isPairUnavailable = (err: unknown): boolean => err instanceof GardenApiError && /insufficient liquidity|no order pair found|invalid (to|from)_asset/i.test(err.message); // Candidate Garden pairs to probe. `serviceSendAsset`/`serviceReceiveAsset` are // set only when the pair is mapped in `garden-mappings.ts` — service-level @@ -49,10 +52,10 @@ describe('Garden Finance API integration', () => { console.log(`Using working Garden pair: ${c.gardenFrom} → ${c.gardenTo}`); return; } catch (err) { - if (!isInsufficientLiquidity(err)) throw err; + if (!isPairUnavailable(err)) throw err; } } - console.warn('No Garden pair returned liquidity — skipping dependent tests'); + console.warn('No Garden pair currently tradeable — skipping dependent tests'); }, 30_000); it('GET /quote returns valid amounts for BTC→', async (ctx) => { From 913a32ffe1e84b3c80de075d81f6900e54ba18e9 Mon Sep 17 00:00:00 2001 From: Jude Nullon Date: Fri, 22 May 2026 15:01:05 +0100 Subject: [PATCH 2/2] fix: ext test --- ext/src/tests/e2e/main.spec.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/ext/src/tests/e2e/main.spec.ts b/ext/src/tests/e2e/main.spec.ts index 7cdcc38c..4767b7e0 100644 --- a/ext/src/tests/e2e/main.spec.ts +++ b/ext/src/tests/e2e/main.spec.ts @@ -188,11 +188,14 @@ test('can switch network', async ({ page, extensionId }) => { // await page.selectOption('[id="networkSelect"]', 'optimism'); await page.getByRole('button', { name: 'Rootstock' }).click(); // allow connecting to the Dapp - // navigating back to the dapp to check current network + // navigating back to the dapp to check current network. reloading the dapp + // drops its EIP-6963 provider selection, so we must re-select it; the dapp + // then auto-reconnects since the permission is already granted. await page.goto('https://metamask.github.io/test-dapp/'); - await sleep(4_000); // waiting for a page to interact with injected provider and load that stuff - const spanText2 = await page.locator('span[id="network"]').textContent(); - expect(parseInt(String(spanText2))).toEqual(30); // current selected network is 10 + await page.getByText(/Use Layerz Wallet/).click(); + + // selected network is now Rootstock (chainId 30) + await expect(page.locator('span[id="network"]')).toHaveText('30', { timeout: 30_000 }); }); test('onboarding: does not have mnemonic', async ({ page, extensionId }) => {