Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
Seroxdesign committed Jan 25, 2024
1 parent 280a9ba commit fd70daa
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions wallets/metamask/test/e2e/metamask/renameAccount.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { testWithSynpress } from '@synthetixio/synpress-fixtures'
import { MetaMask, unlockForFixture } from '../../../src'
import { z } from 'zod'

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

Expand All @@ -16,10 +17,14 @@ test('should rename current account with specified name', async ({ context, meta
await expect(metamaskPage.locator(metamask.homePage.selectors.accountMenu.accountButton)).toHaveText(accountName)
})

test('should throw an error if an empty account name is passed', async ({ context, metamaskPage }) => {
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(
'[RenameAccount] Account name cannot be an empty string'
)
await expect(metamask.renameAccount('')).rejects.toThrowError(z.ZodError)
})

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

await expect(metamask.renameAccount('Account 12')).rejects.toThrowError(z.ZodError)
})

0 comments on commit fd70daa

Please sign in to comment.