Skip to content

Commit

Permalink
fix: format
Browse files Browse the repository at this point in the history
  • Loading branch information
matstyler committed Apr 18, 2024
1 parent a7406fe commit d9a478c
Showing 1 changed file with 23 additions and 44 deletions.
67 changes: 23 additions & 44 deletions wallets/metamask/test/e2e/metamask/connectToDapp.spec.ts
Original file line number Diff line number Diff line change
@@ -1,58 +1,37 @@
import { testWithSynpress } from "@synthetixio/synpress-fixtures";
import { MetaMask, unlockForFixture } from "../../../src";
import { testWithSynpress } from '@synthetixio/synpress-fixtures'
import { MetaMask, unlockForFixture } from '../../../src'

import basicSetup from "../wallet-setup/basic.setup";
import basicSetup from '../wallet-setup/basic.setup'

const test = testWithSynpress(basicSetup, unlockForFixture);
const test = testWithSynpress(basicSetup, unlockForFixture)

const { expect } = test;
const { expect } = test

test("should connect wallet to dapp", async ({
context,
page,
extensionId,
}) => {
const metamask = new MetaMask(
context,
page,
basicSetup.walletPassword,
extensionId
);
test('should connect wallet to dapp', async ({ context, page, extensionId }) => {
const metamask = new MetaMask(context, page, basicSetup.walletPassword, extensionId)

await page.goto("/");
await page.goto('/')

await page.locator("#connectButton").click();
await page.locator('#connectButton').click()

await metamask.connectToDapp();
await metamask.connectToDapp()

await expect(page.locator("#accounts")).toHaveText(
"0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266"
);
});
await expect(page.locator('#accounts')).toHaveText('0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266')
})

test("should connect multiple wallets to dapp", async ({
context,
page,
metamaskPage,
extensionId,
}) => {
const metamask = new MetaMask(
context,
metamaskPage,
basicSetup.walletPassword,
extensionId
);
test('should connect multiple wallets to dapp', async ({ context, page, metamaskPage, extensionId }) => {
const metamask = new MetaMask(context, metamaskPage, basicSetup.walletPassword, extensionId)

await metamask.addNewAccount("Account x2");
await metamask.addNewAccount("Account x3");
await metamask.addNewAccount('Account x2')
await metamask.addNewAccount('Account x3')

await page.goto("/");
await page.locator("#connectButton").click();
await page.goto('/')
await page.locator('#connectButton').click()

// "accounts" param is order agnostic
await metamask.connectToDapp(["Account x2", "Account 1"]);
await metamask.connectToDapp(['Account x2', 'Account 1'])

await expect(page.locator("#accounts")).toHaveText(
"0x70997970c51812dc3a010c7d01b50e0d17dc79c8,0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266"
);
});
await expect(page.locator('#accounts')).toHaveText(
'0x70997970c51812dc3a010c7d01b50e0d17dc79c8,0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266'
)
})

0 comments on commit d9a478c

Please sign in to comment.