Skip to content

Commit

Permalink
fix: keep trying to find mm provider
Browse files Browse the repository at this point in the history
  • Loading branch information
hugomrdias committed Sep 3, 2024
1 parent 19d35a2 commit 6f0096f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion packages/adapter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"scripts": {
"lint": "tsc --build && biome check --no-errors-on-unmatched --files-ignore-unknown=true",
"build": "wireit",
"test": "playwright test"
"test": "pnpm run build && playwright test"
},
"wireit": {
"build": {
Expand Down
4 changes: 2 additions & 2 deletions packages/adapter/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ export async function getProvider(timeout = 1000): Promise<EIP1193Provider> {
break
}
default: {
console.error('Provider not supported or not found.', rdns)
reject(new Error('Provider not supported or not found.'))
// console.error('Provider not supported or not found.', rdns)
// reject(new Error('Provider not supported or not found.'))
break
}
}
Expand Down
17 changes: 8 additions & 9 deletions packages/adapter/test/adapter.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { createFixture } from 'metamask-testing-tools'

const SNAP_ID = 'local:http://localhost:8081'
const SNAP_VERSION = '*'
const METAMASK_VERSION = 'v11.16.5'
const RAINBOW_PASSWORD = '12345678'
const RAINBOW_EXTENSION_ID = 'opfgelmcmbiajamepnmloijbpoleiama'

Expand All @@ -25,7 +24,6 @@ async function setupExtraExtensions(data) {
let fixture = createFixture({
downloadOptions: {
flask: true,
tag: METAMASK_VERSION,
},
})

Expand Down Expand Up @@ -54,7 +52,6 @@ fixture = createFixture({
isolated: true,
downloadOptions: {
flask: true,
tag: METAMASK_VERSION,
},
snap: {
id: SNAP_ID,
Expand All @@ -77,18 +74,20 @@ fixture = createFixture({
downloadOptions: {
flask: true,
extensionsIds: [RAINBOW_EXTENSION_ID],
tag: METAMASK_VERSION,
},
snap: {
id: SNAP_ID,
version: SNAP_VERSION,
},
})

fixture.test(
'should start connect to snap when flask is installed alongside rainbow wallet',
async ({ metamask, page }) => {
await metamask.setupExtraExtensions(setupExtraExtensions)
await metamask.setup({ setupExtraExtensions })
await metamask.installSnap({
id: SNAP_ID,
version: SNAP_VERSION,
page,
})

await page.reload()
await page.getByTestId('connect-snap').click()

const dialog = await metamask.waitForDialog('confirmation')
Expand Down

0 comments on commit 6f0096f

Please sign in to comment.