-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hotfix: Balance display should not show the token and should not form…
…at the amount (#462) Co-authored-by: Andrew Snaith <[email protected]> Co-authored-by: Andrew Snaith <[email protected]>
- Loading branch information
1 parent
8b167ec
commit 20b2fad
Showing
12 changed files
with
206 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { InjectedAccountWitMnemonic } from './testAccounts' | ||
|
||
export const expectedMultisigAddress = '7J9rSWpjfQjSYr1QDKPr6KjhnC2b2kLWfyBTiTpMgkNvD7vr' | ||
|
||
export const extrinsicsDisplayAccounts = { | ||
// it has no token but is part of a multisig | ||
Alice: { | ||
address: '7NPoMQbiA6trJKkjB35uk96MeJD4PGWkLQLH7k7hXEkZpiba', | ||
publicKey: '0xb4b72576a091c5d691c2fd37f6eaa3d51c7480c2baaeab48737e5a209db4a431', | ||
name: 'Alice', | ||
type: 'sr25519', | ||
mnemonic: 'bottom drive obey lake curtain smoke basket hold race lonely fit walk//Alice' | ||
} as InjectedAccountWitMnemonic | ||
} |
4 changes: 4 additions & 0 deletions
4
packages/ui/cypress/support/page-objects/components/expander.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export const expander = { | ||
paramExpander: () => cy.get('[data-cy=label-expander]'), | ||
contentExpander: () => cy.get('[data-cy=content-expander]') | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
import { | ||
expectedMultisigAddress, | ||
extrinsicsDisplayAccounts | ||
} from '../fixtures/extrinsicsDisplayAccounts' | ||
import { landingPageNetwork } from '../fixtures/landingData' | ||
import { accountDisplay } from '../support/page-objects/components/accountDisplay' | ||
import { expander } from '../support/page-objects/components/expander' | ||
import { multisigPage } from '../support/page-objects/multisigPage' | ||
import { sendTxModal } from '../support/page-objects/sendTxModal' | ||
|
||
describe('Verify extrinsics display', () => { | ||
beforeEach(() => { | ||
cy.setupAndVisit({ | ||
url: landingPageNetwork('hydradx'), | ||
extensionConnectionAllowed: true, | ||
injectExtensionWithAccounts: [extrinsicsDisplayAccounts['Alice']] | ||
}) | ||
}) | ||
|
||
it('The omnipool.sell extrinsic is displayed in plank', () => { | ||
multisigPage.accountHeader().within(() => { | ||
accountDisplay.addressLabel().should('contain.text', expectedMultisigAddress.slice(0, 6)) | ||
}) | ||
|
||
multisigPage | ||
.transactionList() | ||
.should('be.visible') | ||
.within(() => { | ||
multisigPage.pendingTransactionItem().should('have.length', 1) | ||
multisigPage.pendingTransactionItem().within(() => { | ||
multisigPage.pendingTransactionCallName().should('contain.text', 'omnipool.sell') | ||
multisigPage.unknownCallIcon().should('not.exist') | ||
multisigPage.unknownCallAlert().should('not.exist') | ||
expander.paramExpander().click() | ||
expander.contentExpander().should('contain', 'amount: 10,000,000,000,000') | ||
expander.contentExpander().should('contain', 'min_buy_amount: 59,509') | ||
}) | ||
}) | ||
}) | ||
|
||
it('A manual omnipool.sell extrinsic creation has input in plank', () => { | ||
multisigPage.newTransactionButton().click() | ||
sendTxModal.sendTxTitle().should('be.visible') | ||
sendTxModal.selectEasySetup().click() | ||
sendTxModal.selectionEasySetupSetupManualExtrinsic().click() | ||
sendTxModal.manualPalletSelection().click() | ||
sendTxModal.optionPallet('omnipool').click() | ||
|
||
sendTxModal.manualMethodSelection().click() | ||
sendTxModal.optionMethod('sell').click() | ||
sendTxModal.paramField('amount').should('be.visible') | ||
sendTxModal.paramField('amount').should('not.contain', 'HDX') | ||
}) | ||
|
||
it('A manual balances.transferKeepAlive extrinsic has input in HDX', () => { | ||
multisigPage.accountHeader().within(() => { | ||
accountDisplay.addressLabel().should('contain.text', expectedMultisigAddress.slice(0, 6)) | ||
}) | ||
|
||
multisigPage.newTransactionButton().click() | ||
sendTxModal.sendTxTitle().should('be.visible') | ||
sendTxModal.selectEasySetup().click() | ||
sendTxModal.selectionEasySetupSetupManualExtrinsic().click() | ||
sendTxModal.manualPalletSelection().click() | ||
sendTxModal.optionPallet('balances').click() | ||
|
||
sendTxModal.manualMethodSelection().click() | ||
sendTxModal.optionMethod('transferKeepAlive').click() | ||
sendTxModal.paramField('value').should('be.visible') | ||
sendTxModal.paramField('value').should('contain', 'HDX') | ||
}) | ||
|
||
it('A from call data balances.transferKeepAlive extrinsic has balance displayed in HDX and identicon for destination', () => { | ||
const balanceTransferCallData = | ||
'0x0703d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d0b00b04e2bde6f' | ||
const sendingAmount = '123 HDX' | ||
const expectedRecipient = '7NPoMQ..kZpiba' | ||
|
||
multisigPage.newTransactionButton().click() | ||
sendTxModal.sendTxTitle().should('be.visible') | ||
sendTxModal.selectEasySetup().click() | ||
sendTxModal.selectionEasySetupSetupFromCallData().click() | ||
sendTxModal.callDataInput().click().type(balanceTransferCallData) | ||
sendTxModal.sendTxContent().within(() => { | ||
expander.contentExpander().should('contain', sendingAmount) | ||
expander.contentExpander().within(() => { | ||
accountDisplay.addressLabel().should('contain', expectedRecipient) | ||
accountDisplay.identicon().should('be.visible') | ||
accountDisplay.nameLabel().should('contain', extrinsicsDisplayAccounts['Alice'].name) | ||
}) | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,7 @@ | ||
export const isTypeBalance = (typeName?: string) => | ||
!!typeName && ['Balance', 'BalanceOf', 'Amount'].includes(typeName) | ||
import { balanceCalls } from '../constants' | ||
|
||
export const isTypeBalanceWithBalanceCall = (typeName?: string, call?: string) => | ||
!!typeName && | ||
!!call && | ||
['Balance', 'BalanceOf', 'Amount'].includes(typeName) && | ||
balanceCalls.includes(call) |