Files
wallet/apps/extension/e2e/tests/smoke/wallet-connection.test.ts
zeekay 78fb1267b6 chore: scrub uniswap — use @luxamm/* (lux fork) only
Replace every @uniswap/* package import with @luxamm/* (lux fork
already canonical for SDK pieces). Replace app.uniswap.org URLs with
lux.exchange, uniswap.org with lux.network. Replace brand strings
(Uniswap Wallet → Lux Wallet, Uniswap Extension → Lux Extension,
Uniswap Labs → Lux Labs Inc.) where they appear in user-facing UI.
Rename handleUniswapAppDeepLink → handleLuxAppDeepLink, also rename
focusOrCreateUniswapInterfaceTab → focusOrCreateLuxInterfaceTab.

Manifest host_permissions updated to lux.exchange and *.lux.network.

Lockfile regeneration: TODO — run pnpm install to refresh after this
commit. Transitive @uniswap/* references in pnpm-lock.yaml are
upstream-package internals.

Protocol-level identifiers (UniswapMethodHandler, UniswapMethods,
UniswapOpenSidebarRequest, handleUniswapX, UniswapXOrderDetails) are
preserved because they reference wire-protocol method names
(uniswap_openSidebar) and external SDK type exports — renaming would
break upstream contracts. iOS Uniswap target directory and
uniswapteam.slack.com / github.com/Uniswap/universe doc refs are
out-of-scope per directive (separate native-build cleanup).

Same hard-banishment rule as tamagui (per feedback memory).
2026-06-10 22:35:41 -07:00

45 lines
1.6 KiB
TypeScript

import { expect } from '@playwright/test'
import { onboardedExtensionTest as test } from 'e2e/fixtures/extension.fixture'
import { waitForBackgroundReady } from 'e2e/utils/extension-helpers'
test.describe('Wallet Connection to Uniswap', () => {
test('extension is detected by Uniswap app', async ({ context }) => {
// Ensure background script is ready
await waitForBackgroundReady(context)
// Open Uniswap app in a new tab
const uniswapPage = await context.newPage()
await uniswapPage.goto('https://lux.exchange', { waitUntil: 'domcontentloaded' })
// Wait a bit for the ethereum provider to be injected
await uniswapPage.waitForTimeout(3000)
// Check that window.ethereum exists
const hasEthereumProvider = await uniswapPage.evaluate(() => {
return typeof window.ethereum !== 'undefined'
})
expect(hasEthereumProvider).toBe(true)
// Check if the provider is properly injected and functional
const providerInfo = await uniswapPage.evaluate(() => {
if (!window.ethereum) {
return null
}
return {
hasRequest: typeof (window.ethereum as any).request === 'function',
hasOn: typeof (window.ethereum as any).on === 'function',
isMetaMask: (window.ethereum as any).isMetaMask || false,
// Get all properties for debugging
properties: Object.getOwnPropertyNames(window.ethereum).sort(),
}
})
expect(providerInfo).not.toBeNull()
expect(providerInfo?.hasRequest).toBe(true)
expect(providerInfo?.hasOn).toBe(true)
// The Uniswap extension presents itself as MetaMask-compatible
expect(providerInfo?.isMetaMask).toBe(true)
})
})