Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions ext/src/tests/e2e/main.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 }) => {
Expand Down
9 changes: 6 additions & 3 deletions shared/tests/integration-vi/garden-transfer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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→<dest>', async (ctx) => {
Expand Down
Loading