Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaw3d committed Oct 21, 2022
1 parent 1c6a6fc commit df65e68
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions cypress/e2e/home.cy.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
describe('The homepage should load', () => {
it('should have options to open the wallet', () => {
cy.visit('/')
cy.findByRole('button', { name: /Open wallet/i })
cy.findByRole('button', { name: /Create wallet/i })
cy.findByRole('link', { name: /Open wallet/i })
cy.findByRole('link', { name: /Create wallet/i })
})
})
14 changes: 7 additions & 7 deletions cypress/e2e/open-wallet.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ describe('Open wallet', () => {
describe('Method selection', () => {
it('Should be able to open from Mnemonic', () => {
cy.visit('/open-wallet')
cy.findByRole('button', { name: /Mnemonic/ }).click()
cy.findByRole('link', { name: /Mnemonic/ }).click()
cy.url().should('include', 'mnemonic')
})

it('Should be able to open from private key', () => {
cy.visit('/open-wallet')
cy.findByRole('button', { name: /Private key/ }).click()
cy.findByRole('link', { name: /Private key/ }).click()
cy.url().should('include', 'private-key')
})
})
Expand Down Expand Up @@ -52,8 +52,8 @@ describe('Open wallet', () => {

// Should allow importing and reselecting the same accounts
cy.findByRole('link', { name: /Home/ }).click()
cy.findByRole('button', { name: /Open wallet/ }).click()
cy.findByRole('button', { name: /Mnemonic/ }).click()
cy.findByRole('link', { name: /Open wallet/ }).click()
cy.findByRole('link', { name: /Mnemonic/ }).click()
cy.url().should('include', '/open-wallet/mnemonic')

cy.findByTestId('mnemonic').type(mnemonic, { delay: 1 })
Expand Down Expand Up @@ -97,8 +97,8 @@ describe('Open wallet', () => {

// Should allow importing and reselecting the same account
cy.findByRole('link', { name: /Home/ }).click()
cy.findByRole('button', { name: /Open wallet/ }).click()
cy.findByRole('button', { name: /Private key/ }).click()
cy.findByRole('link', { name: /Open wallet/ }).click()
cy.findByRole('link', { name: /Private key/ }).click()
cy.url().should('include', '/open-wallet/private-key')
cy.findByPlaceholderText('Enter your private key here').type(privateKey, { delay: 1 })
cy.findByRole('button', { name: /Import my wallet/ }).click()
Expand Down Expand Up @@ -128,6 +128,6 @@ describe('Open wallet', () => {
// cy.get('button[aria-label="Close Wallet"]').click()

// // Back to homepage
// cy.findByRole('button', { name: /Create wallet/i }).should('be.visible')
// cy.findByRole('link', { name: /Create wallet/i }).should('be.visible')
// })
})
8 changes: 4 additions & 4 deletions cypress/e2e/scenario-account-switcher.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ describe('Scenario : multiple accounts', () => {
cy.visit('/')

// Open account 1 through mnemonic
cy.findByRole('button', { name: /Open wallet/ }).click()
cy.findByRole('button', { name: /Mnemonic/ }).click()
cy.findByRole('link', { name: /Open wallet/ }).click()
cy.findByRole('link', { name: /Mnemonic/ }).click()
cy.findByTestId('mnemonic').type(
'abuse gown claw final toddler wedding sister parade useful typical spatial skate decrease bulk student manual cloth shove fat car little swamp tag ginger',
{ delay: 0 },
Expand All @@ -16,8 +16,8 @@ describe('Scenario : multiple accounts', () => {
cy.findByTestId('nav-home').click()

// Open account 2 through private
cy.findByRole('button', { name: /Open wallet/ }).click()
cy.findByRole('button', { name: /Private key/ }).click()
cy.findByRole('link', { name: /Open wallet/ }).click()
cy.findByRole('link', { name: /Private key/ }).click()
cy.findByPlaceholderText('Enter your private key here').type(
'X0jlpvskP1q8E6rHxWRJr7yTvpCuOPEKBGW8gtuVTxfnViTI0s2fBizgMxNzo75Q7w7MxdJXtOLeqDoFUGxxMg==',
{ delay: 0 },
Expand Down
8 changes: 4 additions & 4 deletions cypress/e2e/scenario-transaction.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ describe('Scenario : from mnemonic', () => {

it('Should open the account', () => {
cy.visit('/')
cy.findByRole('button', { name: /Open wallet/ }).click()
cy.findByRole('button', { name: /Mnemonic/ }).click()
cy.findByRole('link', { name: /Open wallet/ }).click()
cy.findByRole('link', { name: /Mnemonic/ }).click()
cy.findByTestId('mnemonic').type(
'abuse gown claw final toddler wedding sister parade useful typical spatial skate decrease bulk student manual cloth shove fat car little swamp tag ginger',
{ delay: 1 },
Expand Down Expand Up @@ -84,8 +84,8 @@ describe('Scenario : from private key', () => {

it('Should open the account', () => {
cy.visit('/')
cy.findByRole('button', { name: /Open wallet/ }).click()
cy.findByRole('button', { name: /Private key/ }).click()
cy.findByRole('link', { name: /Open wallet/ }).click()
cy.findByRole('link', { name: /Private key/ }).click()
cy.findByPlaceholderText('Enter your private key here').type(
'X0jlpvskP1q8E6rHxWRJr7yTvpCuOPEKBGW8gtuVTxfnViTI0s2fBizgMxNzo75Q7w7MxdJXtOLeqDoFUGxxMg==',
{ delay: 1 },
Expand Down

0 comments on commit df65e68

Please sign in to comment.