Skip to content

Commit

Permalink
address pr feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
asnaith committed Nov 30, 2023
1 parent e7f1a52 commit 312cfca
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,6 @@ export const signatoryOfMultipleMultisigs = {
mnemonic: 'cement risk mutual large fluid run witness vintage civil pipe cost weasel',
multisigWithPureAddress1: '5EKfTP24LJvTDLf3GP3vvJASv1jXmcZumFWGcSzVQ66epXZe',
multisigWithPureAddress2: '5ENJzVn5CcVrzSi9dfmysrFWQ6Ce5iX3L22sa1bnZN8KvGBT',
multisigWithoutPureAddress: '5HoPXnwfDpqhgNYGMSZTzhdvc3TDSvd41XDaVMg7yUo8W5un'
multisigWithoutPureAddress: '5HoPXnwfDpqhgNYGMSZTzhdvc3TDSvd41XDaVMg7yUo8W5un',
publicKey: '0x12315840d264e4274a7122d8150bb8c5205d3cdc1b92a5c854ce90ae9b0f9e77'
}
70 changes: 44 additions & 26 deletions packages/ui/cypress/tests/watched-accounts.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,75 +241,93 @@ describe('Watched Accounts', () => {
})

it('can see the same details displayed when watching a pure or its multisig address', () => {
const { purePublicKey, address: multisigAddress } = watchMultisigs['multisig-with-pure']
const {
purePublicKey,
pureAddress,
publicKey: multisigPublicKey,
address: multisigAddress
} = watchMultisigs['multisig-with-pure']

// watch the pure public key
cy.visitWithLocalStorage({
url: landingPageUrl,
watchedAccounts: [purePublicKey]
})
// store details of the displayed addresses for later comparison
multisigPage.accountHeader().within(() => {
accountDisplay.addressLabel().should('be.visible').invoke('text').as('headerPureAddress')
})
// ensure expected display when watching via the public key
multisigPage
.accountHeader()
.should('be.visible')
.within(() => {
accountDisplay
.addressLabel()
.should('be.visible')
.and('contain.text', pureAddress.slice(0, 6))
})
multisigPage.multisigDetailsContainer().within(() => {
multisigPage.multisigAccountSummary().within(() => {
accountDisplay
.addressLabel()
.should('be.visible')
.invoke('text')
.as('controllingMultisigAddress')
.and('contain.text', multisigAddress.slice(0, 6))
})
})
topMenuItems.multiproxySelector().should('be.visible').first().click()
topMenuItems
.multiproxySelectorOption()
// ensure there is only one option, the pure, in the multiproxy selector
.should('have.length', 1)
.within(() => {
accountDisplay.pureBadge().should('be.visible')
accountDisplay.addressLabel().should('be.visible').invoke('text').as('dropdownPureAddress')
accountDisplay
.addressLabel()
.should('be.visible')
.and('contain.text', pureAddress.slice(0, 6))
})
// now watch via the multisig address and ensure that we see the same details displayed
// now watch via the multisig public key and ensure that we see the same details displayed
cy.visitWithLocalStorage({
url: landingPageUrl,
watchedAccounts: [multisigAddress]
watchedAccounts: [multisigPublicKey]
})
// ensure the pure address is still displayed in the account header
multisigPage.accountHeader().within(() => {
cy.get<string>('@headerPureAddress').then((headerPureAddress) => {
accountDisplay.addressLabel().should('have.text', headerPureAddress)
})
accountDisplay
.addressLabel()
.should('be.visible')
.and('contain.text', pureAddress.slice(0, 6))
})
// ensure the multisig address is still displayed in the multisig details container
multisigPage.multisigDetailsContainer().within(() => {
multisigPage.multisigAccountSummary().within(() => {
cy.get<string>('@controllingMultisigAddress').then((controllingMultisigAddress) => {
accountDisplay.addressLabel().should('have.text', controllingMultisigAddress)
})
accountDisplay
.addressLabel()
.should('be.visible')
.and('contain.text', multisigAddress.slice(0, 6))
})
})
// ensure the pure address is still the only option in the multiproxy selector
topMenuItems.multiproxySelector().should('be.visible').first().click()
topMenuItems
.multiproxySelectorOption()
// ensure there is still only one option, the pure, in the multiproxy selector
.should('have.length', 1)
.within(() => {
accountDisplay.pureBadge().should('be.visible')
cy.get<string>('@dropdownPureAddress').then((dropdownPureAddress) => {
accountDisplay.addressLabel().should('have.text', dropdownPureAddress)
})
accountDisplay
.addressLabel()
.should('be.visible')
.and('contain.text', pureAddress.slice(0, 6))
})
})

it('can see all multisigs that a watched signatory is a member of', () => {
const signatory = signatoryOfMultipleMultisigs.address
const { publicKey: signatoryPublicKey } = signatoryOfMultipleMultisigs
const expectedAddresses = [
signatoryOfMultipleMultisigs.multisigWithPure1.address,
signatoryOfMultipleMultisigs.multisigWithPure2.address,
signatoryOfMultipleMultisigs.multisigWithoutPure.address
signatoryOfMultipleMultisigs.multisigWithPureAddress1,
signatoryOfMultipleMultisigs.multisigWithPureAddress2,
signatoryOfMultipleMultisigs.multisigWithoutPureAddress
]

cy.visitWithLocalStorage({
url: landingPageUrl,
watchedAccounts: [signatory]
watchedAccounts: [signatoryPublicKey]
})
topMenuItems.multiproxySelector().should('be.visible').first().click()
// ensure all multisigs are displayed in the multiproxy selector
Expand Down

0 comments on commit 312cfca

Please sign in to comment.