Skip to content

Commit

Permalink
fix tests hidden account
Browse files Browse the repository at this point in the history
  • Loading branch information
Tbaut committed Mar 3, 2025
1 parent 50de63d commit 62cff39
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions packages/ui/cypress/tests/hidden-accounts.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ describe('Hidden Accounts', () => {
})
goToHiddenAccountSettings()
topMenuItems.multiproxySelectorDesktop().should('be.visible').click()
topMenuItems.multiproxySelectorOptionDesktop().should('have.length', 2)
topMenuItems.multiproxySelectorOptionDesktop().should('have.length', 3)

//hide random account
addHiddenAccount(randomAddress)
topMenuItems.multiproxySelectorDesktop().should('be.visible').click()
topMenuItems.multiproxySelectorOptionDesktop().should('have.length', 2)
topMenuItems.multiproxySelectorOptionDesktop().should('have.length', 3)
settingsPage.hiddenAccountsContainer().should('be.visible')
settingsPage.hiddenAccountsContainer().within(() => {
accountDisplay.identicon().should('be.visible')
Expand All @@ -58,13 +58,13 @@ describe('Hidden Accounts', () => {
settingsPage.hiddenAccountsContainer().should('have.length', 2)
topMenuItems.multiproxySelectorDesktop().should('be.visible').click()
// the multisig should be hidden
topMenuItems.multiproxySelectorOptionDesktop().should('have.length', 1)
topMenuItems.multiproxySelectorOptionDesktop().should('have.length', 2)
topMenuItems
.multiproxySelectorOptionDesktop()
.should('contain', westendMemberAccount.hidden.expectedPure.address.slice(0, 6))
})

it('hides all accounts sequentially and we switches to the available accounts if any', () => {
it('hides all accounts sequentially and it switches to the available accounts if any', () => {
cy.setupAndVisit({
url: landingPageNetworkAddress({
network: 'westend',
Expand Down Expand Up @@ -95,7 +95,7 @@ describe('Hidden Accounts', () => {
})

topMenuItems.multiproxySelectorDesktop().should('be.visible').click()
topMenuItems.multiproxySelectorOptionDesktop().should('have.length', 1)
topMenuItems.multiproxySelectorOptionDesktop().should('have.length', 2)
goToHiddenAccountSettings()
settingsPage
.hiddenAccountsContainer()
Expand All @@ -108,8 +108,9 @@ describe('Hidden Accounts', () => {
settingsPage.hiddenAccountDeleteButton().should('be.visible')
})

// hide all accounts and expect an error
// hide all other accounts and expect an error
addHiddenAccount(westendMemberAccount.hidden.expectedSingleMultisig.westendAddress)
addHiddenAccount(westendMemberAccount.noIdentity.expectedSingleMultisig.westendAddress)
topMenuItems.multiproxySelectorDesktop().should('not.exist')
topMenuItems.homeButton().click()
landingPage
Expand Down Expand Up @@ -189,7 +190,7 @@ describe('Hidden Accounts', () => {
landingPage.transactionListLoader().should('not.exist')
cy.url().should('include', westendMemberAccount.hidden.expectedSingleMultisig.westendAddress)
topMenuItems.multiproxySelectorDesktop().should('be.visible').click()
topMenuItems.multiproxySelectorOptionDesktop().should('have.length', 1)
topMenuItems.multiproxySelectorOptionDesktop().should('have.length', 2)
goToHiddenAccountSettings()
settingsPage
.hiddenAccountsContainer()
Expand All @@ -204,7 +205,7 @@ describe('Hidden Accounts', () => {
settingsPage.hiddenAccountDeleteButton().should('be.visible').click()
settingsPage.hiddenAccountsContainer().should('not.exist')
topMenuItems.multiproxySelectorDesktop().should('be.visible').click()
topMenuItems.multiproxySelectorOptionDesktop().should('have.length', 2)
topMenuItems.multiproxySelectorOptionDesktop().should('have.length', 3)
topMenuItems.homeButton().click()

// hide it again but say to not view the message again
Expand All @@ -215,7 +216,7 @@ describe('Hidden Accounts', () => {
hiddenAccountInfoModal.gotItButton().should('be.visible').click()

topMenuItems.multiproxySelectorDesktop().should('be.visible').click()
topMenuItems.multiproxySelectorOptionDesktop().should('have.length', 1)
topMenuItems.multiproxySelectorOptionDesktop().should('have.length', 2)
goToHiddenAccountSettings()
settingsPage.hiddenAccountsContainer().should('have.length', 1)

Expand All @@ -224,13 +225,13 @@ describe('Hidden Accounts', () => {

topMenuItems.homeButton().click()
topMenuItems.multiproxySelectorDesktop().should('be.visible').click()
topMenuItems.multiproxySelectorOptionDesktop().should('have.length', 2)
topMenuItems.multiproxySelectorOptionDesktop().should('have.length', 3)

multisigPage.optionsMenuButton().click()
multisigPage.hideAccountMenuOption().should('exist').click()
hiddenAccountInfoModal.body().should('not.exist')
topMenuItems.multiproxySelectorDesktop().should('be.visible').click()
topMenuItems.multiproxySelectorOptionDesktop().should('have.length', 1)
topMenuItems.multiproxySelectorOptionDesktop().should('have.length', 2)
})

it('removes a watched account if hidding a watched account', () => {
Expand All @@ -245,7 +246,7 @@ describe('Hidden Accounts', () => {
})

topMenuItems.multiproxySelectorDesktop().click()
topMenuItems.multiproxySelectorOptionDesktop().should('have.length', 3)
topMenuItems.multiproxySelectorOptionDesktop().should('have.length', 4)

// hide the watched account
multisigPage.optionsMenuButton().click()
Expand All @@ -254,7 +255,7 @@ describe('Hidden Accounts', () => {
hiddenAccountInfoModal.gotItButton().click()

topMenuItems.multiproxySelectorDesktop().click()
topMenuItems.multiproxySelectorOptionDesktop().should('have.length', 2)
topMenuItems.multiproxySelectorOptionDesktop().should('have.length', 3)
goToHiddenAccountSettings()
settingsPage.hiddenAccountsContainer().should('not.exist')
settingsPage.watchedAccountsAccordion().click()
Expand Down

0 comments on commit 62cff39

Please sign in to comment.