Skip to content

Commit

Permalink
fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
asnaith committed Oct 11, 2023
1 parent 079eb95 commit 0a9fd97
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 51 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ export const watchMultisigs = {
threshold: 2,
signatories: [watchSignatories[2].address, watchSignatories[3].address]
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ export const watchSignatories = [
type: 'sr25519',
mnemonic: 'mutual pluck punch boy gym key brush dune master aunt track dynamic'
}
]
]
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export const accountDisplay = {
identicon: () => cy.get('[data-cy=icon-identicon]'),
pureBadge: () => cy.get('[data-cy=badge-pure]'),
multisigBadge: () => cy.get('[data-cy=badge-multisig]'),
nameLabel: () => cy.get('[data-cy=label-account-name]'),
addressLabel: () => cy.get('[data-cy=label-account-address]'),
}
identicon: () => cy.get('[data-cy=icon-identicon]'),
pureBadge: () => cy.get('[data-cy=badge-pure]'),
multisigBadge: () => cy.get('[data-cy=badge-multisig]'),
nameLabel: () => cy.get('[data-cy=label-account-name]'),
addressLabel: () => cy.get('[data-cy=label-account-address]')
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
export const editNamesModal = {
body: () => cy.get('[data-cy=modal-edit-names]'),
inputEditPureName: () => cy.get('[data-cy=input-edit-pure-name]'),
inputEditMultisigName: () => cy.get('[data-cy=input-edit-multisig-name]'),
inputEditSignatoryName: () => cy.get('[data-cy=input-edit-signatory-name]'),
saveButton:() => cy.get('[data-cy=button-save-edited-names]'),
}

body: () => cy.get('[data-cy=modal-edit-names]'),
inputEditPureName: () => cy.get('[data-cy=input-edit-pure-name]'),
inputEditMultisigName: () => cy.get('[data-cy=input-edit-multisig-name]'),
inputEditSignatoryName: () => cy.get('[data-cy=input-edit-signatory-name]'),
saveButton: () => cy.get('[data-cy=button-save-edited-names]')
}
65 changes: 29 additions & 36 deletions packages/ui/cypress/tests/watched-accounts.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,65 +68,60 @@ describe('Watched Accounts', () => {
cy.visit(settingsPageWatchAccountUrl)
addWatchAccount(
watchMultisigs['multisig-without-pure'].address,
watchMultisigs['multisig-without-pure'].name)
watchMultisigs['multisig-without-pure'].name
)
// ensure the multisig name is displayed in the settings account container
settingsPage.accountContainer().within(() => {
accountDisplay.nameLabel()
accountDisplay
.nameLabel()
.should('be.visible')
.should('have.text', watchMultisigs['multisig-without-pure'].name)
})
// ensure the name is included in the selectable drop-down option
topMenuItems.multiproxySelector()
.should('be.visible')
.first().click()
topMenuItems.multiproxySelector().should('be.visible').first().click()
topMenuItems.multiproxySelectorOption().within(() => {
accountDisplay.nameLabel()
.should('have.text', watchMultisigs['multisig-without-pure'].name)
accountDisplay.nameLabel().should('have.text', watchMultisigs['multisig-without-pure'].name)
})
// ensure the name is displayed in the home page header
topMenuItems.homeButton().click()
multisigPage.accountHeader().within(() => {
accountDisplay.nameLabel()
.should('have.text', watchMultisigs['multisig-without-pure'].name)
accountDisplay.nameLabel().should('have.text', watchMultisigs['multisig-without-pure'].name)
})
})

it('can see the provided name displayed for a watched pure', () => {
cy.visit(settingsPageWatchAccountUrl)
addWatchAccount(
watchMultisigs['multisig-with-pure'].pureAddress,
watchMultisigs['multisig-with-pure'].name)
watchMultisigs['multisig-with-pure'].name
)
// ensure the multisig name is displayed in the settings account container
settingsPage.accountContainer().within(() => {
accountDisplay.nameLabel()
accountDisplay
.nameLabel()
.should('be.visible')
.should('have.text', watchMultisigs['multisig-with-pure'].name)
})
// ensure the name is included in the selectable drop-down option
topMenuItems.multiproxySelector()
.should('be.visible')
.first().click()
topMenuItems.multiproxySelector().should('be.visible').first().click()
topMenuItems.multiproxySelectorOption().within(() => {
accountDisplay.nameLabel()
.should('have.text', watchMultisigs['multisig-with-pure'].name)
accountDisplay.nameLabel().should('have.text', watchMultisigs['multisig-with-pure'].name)
})
// navigate to the multisig page and ensure the name is included in the home page header
topMenuItems.homeButton().click()
multisigPage.accountHeader().within(() => {
accountDisplay.nameLabel()
.should('have.text', watchMultisigs['multisig-with-pure'].name)
accountDisplay.nameLabel().should('have.text', watchMultisigs['multisig-with-pure'].name)
})
})

it('can see the identicon and badge displayed for a watched multisig', () => {
cy.visit(settingsPageWatchAccountUrl)
addWatchAccount(
watchMultisigs['multisig-without-pure'].address,
watchMultisigs['multisig-without-pure'].name)
watchMultisigs['multisig-without-pure'].name
)
// ensure the multisig badge is displayed in the selectable drop-down option
topMenuItems.multiproxySelector()
.should('be.visible')
.first().click()
topMenuItems.multiproxySelector().should('be.visible').first().click()
topMenuItems.multiproxySelectorOption().within(() => {
accountDisplay.identicon().should('be.visible')
accountDisplay.multisigBadge().should('be.visible')
Expand All @@ -145,11 +140,10 @@ describe('Watched Accounts', () => {
cy.visit(settingsPageWatchAccountUrl)
addWatchAccount(
watchMultisigs['multisig-with-pure'].pureAddress,
watchMultisigs['multisig-with-pure'].name)
watchMultisigs['multisig-with-pure'].name
)
// ensure the pure badge is displayed in the selectable drop-down option
topMenuItems.multiproxySelector()
.should('be.visible')
.first().click()
topMenuItems.multiproxySelector().should('be.visible').first().click()
topMenuItems.multiproxySelectorOption().within(() => {
accountDisplay.identicon().should('be.visible')
accountDisplay.pureBadge().should('be.visible')
Expand All @@ -168,35 +162,33 @@ describe('Watched Accounts', () => {
cy.visit(settingsPageWatchAccountUrl)
addWatchAccount(
watchMultisigs['multisig-with-pure'].pureAddress,
watchMultisigs['multisig-with-pure'].name)
watchMultisigs['multisig-with-pure'].name
)
// navigate to the home page and edit the name
topMenuItems.homeButton().click()
multisigPage.optionsMenuButton().click()
multisigPage.editNamesMenuOption().click()
editNamesModal.body().should('be.visible')
editNamesModal.inputEditPureName().type(`{selectall}{del}${`Edited Name Test`}`)
cy.wait(500)
editNamesModal.saveButton()
.should('be.enabled')
.click()
editNamesModal.saveButton().should('be.enabled').click()
// ensure the edited name is now displayed in the home page header
multisigPage.accountHeader().within(() => {
accountDisplay.nameLabel()
.should('have.text', 'Edited Name Test')
accountDisplay.nameLabel().should('have.text', 'Edited Name Test')
})
// navigate to settings and ensure the edited name is displayed
cy.visit(settingsPageWatchAccountUrl)
settingsPage.accountContainer().within(() => {
accountDisplay.nameLabel()
.should('have.text', 'Edited Name Test')
accountDisplay.nameLabel().should('have.text', 'Edited Name Test')
})
})

it('can see a subscan link for a watched pure', () => {
cy.visit(settingsPageWatchAccountUrl)
addWatchAccount(
watchMultisigs['multisig-with-pure'].pureAddress,
watchMultisigs['multisig-with-pure'].name)
watchMultisigs['multisig-with-pure'].name
)
// navigate to the home page and edit the name
topMenuItems.homeButton().click()
multisigPage.optionsMenuButton().click()
Expand All @@ -207,7 +199,8 @@ describe('Watched Accounts', () => {
cy.visit(settingsPageWatchAccountUrl)
addWatchAccount(
watchMultisigs['multisig-with-pure'].pureAddress,
watchMultisigs['multisig-with-pure'].name)
watchMultisigs['multisig-with-pure'].name
)
topMenuItems.homeButton().click()
multisigPage.accountHeader().should('be.visible')
multisigPage.newTransactionButton().should('not.exist')
Expand Down

0 comments on commit 0a9fd97

Please sign in to comment.