Skip to content

Commit

Permalink
remove test
Browse files Browse the repository at this point in the history
  • Loading branch information
Seroxdesign committed Jun 20, 2024
1 parent e6ba9fc commit 8e9056c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 20 deletions.
14 changes: 1 addition & 13 deletions wallets/metamask/src/pages/HomePage/actions/renameAccount.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,7 @@
import type { Page } from '@playwright/test'
import { z } from 'zod'
import Selectors from '../selectors'

// @todo, look into validation schema that's language agnostic for Metamask reserved words (""Account 1", "Account 2", etc.)
const Account = z.object({
name: z.string().refine((value) => {
return value.trim().length > 0
}, 'Invalid account name')
})

export type Account = z.infer<typeof Account>

export async function renameAccount(page: Page, newAccountName: Account['name']) {
Account.parse({ name: newAccountName })

export async function renameAccount(page: Page, newAccountName: string) {
await page.locator(Selectors.accountMenu.accountButton).click()
await page.locator(Selectors.accountMenu.renameAccountMenu.listItemButton).nth(0).click()
await page.locator(Selectors.threeDotsMenu.accountDetailsButton).click()
Expand Down
8 changes: 1 addition & 7 deletions wallets/metamask/test/e2e/renameAccount.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,11 @@ const test = testWithSynpress(metaMaskFixtures(basicSetup))

const { expect } = test

test('should rename current account with specified name', async ({ context, metamaskPage }) => {
test.only('should rename current account with specified name', async ({ context, metamaskPage }) => {
const metamask = new MetaMask(context, metamaskPage, basicSetup.walletPassword)

const accountName = 'Test Account'
await metamask.renameAccount(accountName)

await expect(metamaskPage.locator(metamask.homePage.selectors.accountMenu.accountButton)).toHaveText(accountName)
})

test('should throw Zod error if an empty account name is passed', async ({ context, metamaskPage }) => {
const metamask = new MetaMask(context, metamaskPage, basicSetup.walletPassword)

await expect(metamask.renameAccount('')).rejects.toThrowError('Invalid account name')
})

0 comments on commit 8e9056c

Please sign in to comment.