fix: connect wallet explicitly in conversion-funnel deep link test

The wallet provider no longer auto-connects via eth_accounts, so the
deep link test must explicitly connect the wallet before verifying
the swap widget renders its input and buy button.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
johba 2026-03-25 10:20:35 +00:00
parent 5402b51eaa
commit 76579d4c5b

View file

@ -296,8 +296,24 @@ test.describe('Conversion Funnel: Landing → Swap → Stake', () => {
const hasLocalSwap = await localSwapWidget.isVisible({ timeout: 5_000 }).catch(() => false); const hasLocalSwap = await localSwapWidget.isVisible({ timeout: 5_000 }).catch(() => false);
if (hasLocalSwap) { if (hasLocalSwap) {
console.log('[DEEPLINK] Local swap mode — verifying swap widget is functional'); console.log('[DEEPLINK] Local swap mode — connecting wallet first');
// With wallet context, the swap input and buy button should be visible // The wallet must be explicitly connected for the swap input to render.
// Navigate to main page to access the connect button, then return.
const navbarTitle = page.locator('.navbar-title').first();
await navbarTitle.waitFor({ state: 'visible', timeout: 30_000 });
await page.evaluate(() => window.dispatchEvent(new Event('resize')));
const connectBtn = page.locator('.connect-button--disconnected').first();
if (await connectBtn.isVisible({ timeout: 10_000 }).catch(() => false)) {
await connectBtn.click();
const connector = page.locator('.connectors-element').first();
await connector.waitFor({ state: 'visible', timeout: 10_000 });
await connector.click();
// Wait for wallet to connect
await page.getByText(/0x[a-fA-F0-9]{4}/i).first().waitFor({ state: 'visible', timeout: 15_000 });
console.log('[DEEPLINK] Wallet connected');
}
console.log('[DEEPLINK] Verifying swap widget is functional');
// With wallet connected, the swap input and buy button should be visible
await expect(page.locator('[data-testid="swap-amount-input"]')).toBeVisible({ timeout: 5_000 }); await expect(page.locator('[data-testid="swap-amount-input"]')).toBeVisible({ timeout: 5_000 });
await expect(page.getByTestId('swap-buy-button')).toBeVisible(); await expect(page.getByTestId('swap-buy-button')).toBeVisible();
console.log('[DEEPLINK] ✅ Local swap widget verified'); console.log('[DEEPLINK] ✅ Local swap widget verified');