Skip to content
This repository has been archived by the owner on Oct 31, 2024. It is now read-only.

Commit

Permalink
test: remove Edena (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastiendan authored Aug 29, 2023
1 parent a66bfcb commit 2adf424
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 33 deletions.
16 changes: 1 addition & 15 deletions packages/frontend/cypress/e2e/step0.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,14 @@ describe('Multistep form step-0 after MetaMask connect', () => {
)
})

it('should list Topos, Incal, and Edena', () => {
it('should list Topos, and Incal', () => {
cy.get('#sendingSubnet').click()
cy.get('.ant-select-item-option-content')
.contains('Topos')
.and('be.visible')
cy.get('.ant-select-item-option-content')
.contains('Incal')
.should('be.visible')
cy.get('.ant-select-item-option-content')
.contains('Edena')
.should('be.visible')
})

it('should open MetaMask to add Topos network when click on Topos', () => {
Expand All @@ -72,13 +69,6 @@ describe('Multistep form step-0 after MetaMask connect', () => {
cy.allowMetamaskToAddAndSwitchNetwork()
})

it('should open MetaMask to add Edena network when click on Edena', () => {
cy.get('#sendingSubnet').click()
cy.get('.ant-select-item-option-content').contains('Edena').click()
cy.get('.ant-select-selection-item').should('have.text', 'Edena')
cy.allowMetamaskToAddAndSwitchNetwork()
})

it('should not ask to add networks when switching back to them', () => {
cy.get('#sendingSubnet').click()
cy.get('.ant-select-item-option-content').contains('Topos').click()
Expand All @@ -87,10 +77,6 @@ describe('Multistep form step-0 after MetaMask connect', () => {
cy.get('#sendingSubnet').click({ force: true })
cy.get('.ant-select-item-option-content').contains('Incal').click()
cy.allowMetamaskToSwitchNetwork()

cy.get('#sendingSubnet').click({ force: true })
cy.get('.ant-select-item-option-content').contains('Edena').click()
cy.allowMetamaskToSwitchNetwork()
})

it('should invalidate form if trying to next without sending subnet', () => {
Expand Down
41 changes: 24 additions & 17 deletions packages/frontend/cypress/e2e/step1.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,30 @@ describe('Multistep form step-1 with Topos', () => {
.contains(SUCCESS.REGISTERED_TOKEN)
.should('be.visible')
})

it('should invalidate form if token not registered on selected receiving subnet', () => {
cy.get('#token').click()
cy.wait(500)
cy.get('#token_list')
.parent()
.find('.ant-select-item-option-content')
.contains('TST')
.click()
cy.get('#receivingSubnet').click()
cy.wait(500)
cy.get('#receivingSubnet_list')
.parent()
.find('.ant-select-item-option-content')
.contains('Incal')
.click()
cy.get('#receivingSubnet')
.parents('.ant-form-item')
.should('have.class', 'ant-form-item-has-error')
cy.get('#receivingSubnet_help').should(
'have.text',
`TST is not registered on Incal!`
)
})
})

describe('Multistep form step-1 with Incal', () => {
Expand Down Expand Up @@ -251,23 +275,6 @@ describe('Multistep form step-1 with Incal', () => {
cy.get('#amount_help').should('have.text', ERROR.MISSING_AMOUNT)
})

it('should invalidate form if token not registered on selected receiving subnet', () => {
cy.get('#receivingSubnet').click()
cy.wait(500)
cy.get('#receivingSubnet_list')
.parent()
.find('.ant-select-item-option-content')
.contains('Edena')
.click()
cy.get('#receivingSubnet')
.parents('.ant-form-item')
.should('have.class', 'ant-form-item-has-error')
cy.get('#receivingSubnet_help').should(
'have.text',
`TST is not registered on Edena!`
)
})

it('should invalidate form if address is invalid', () => {
cy.get('#recipientAddress').type('this is an invalid address')
cy.get('#recipientAddress')
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/components/MultiStepForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export interface StepProps {
}

export enum TransactionType {
ASSET_TRANSFER = 'Asset Transfer',
ASSET_TRANSFER = 'ERC20 Token Transfer',
// SMART_CONTRACT_CALL = 'Smart Contract Call',
}

Expand Down

0 comments on commit 2adf424

Please sign in to comment.