Files
wallet/apps/extension/e2e/fixtures/onboarded-extension.fixture.ts
zeekay 169927b78b refactor: strip duplicate pkgs, consume @l.x/* from npm — keep only pkgs/wallet (canonical @luxfi/wallet bones)
- Delete pkgs/{analytics,api,config,eslint-config,gating,lx,notifications,
  prices,sessions,ui,utilities} — all identical to ~/work/lux/exchange
  canonical (MD5-matched). Now published to npm at @l.x/*; consume from
  there instead of vendoring.
- pkgs/wallet remains — this IS @luxfi/wallet (the uniswap-style extension
  + mobile wallet bones). Published at 1.0.10.
- Rewrite 3553 bare-path imports (uniswap/src/, ui/src/, utilities/src/,
  lx/src/, lux/src/) → explicit @l.x/* across 725 files.
- apps/{extension,mobile}/package.json: workspace:^ → npm ^versions for
  all @l.x/* / @luxfi/eslint-config; only @luxfi/wallet stays workspace.
- apps/{extension,mobile}/.eslintrc.js: RULES_DIR → node_modules/@l.x/lx/eslint_rules.

~315K line deletion. One canonical home: ~/work/lux/exchange.
2026-04-23 17:58:21 -07:00

51 lines
1.8 KiB
TypeScript

/* oxlint-disable no-console -- fixture file */
/* oxlint-disable react-hooks/rules-of-hooks -- Playwright fixtures use `use()` which is not a React hook */
import { type BrowserContext, test as base } from '@playwright/test'
import { createExtensionContext } from 'e2e/fixtures/extension-context'
import { completeOnboarding } from 'e2e/utils/onboarding-helpers'
import { waitForExtensionLoad } from 'e2e/utils/wait-for-extension'
import { ONE_SECOND_MS } from '@l.x/utils/src/time/time'
interface OnboardedExtensionFixtures {
context: BrowserContext
extensionId: string
}
// Extension test fixture that programmatically completes onboarding
export const onboardedExtensionTest = base.extend<OnboardedExtensionFixtures>({
// oxlint-disable-next-line no-empty-pattern -- fixture file
context: async ({}, use) => {
const context = await createExtensionContext({
userDataDirPrefix: 'playwright-extension-onboarded',
})
try {
// Wait for extension to load and onboarding to appear
const { onboardingPage } = await waitForExtensionLoad(context, {
timeout: ONE_SECOND_MS * 10,
waitForOnboarding: true,
})
// Complete onboarding programmatically
if (onboardingPage) {
await completeOnboarding(context, onboardingPage)
} else {
// Try to complete onboarding anyway - it might open later
await completeOnboarding(context)
}
} catch (error) {
console.error('Failed to complete onboarding:', error)
await context.close()
throw error
}
await use(context)
await context.close()
},
extensionId: async ({ context }, use) => {
const { extensionId } = await waitForExtensionLoad(context, { timeout: ONE_SECOND_MS * 10 })
await use(extensionId)
},
})