mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-22 01:47:00 +01:00
UX Multichain: Fixed fiat and eth value in Account List Menu (#20334)
* swapped fiat and eth valu * updated e2e test for account list and token value * updated fixture
This commit is contained in:
parent
2ff289e271
commit
90adb4617b
85
test/e2e/tests/account-token-list.spec.js
Normal file
85
test/e2e/tests/account-token-list.spec.js
Normal file
@ -0,0 +1,85 @@
|
||||
const { strict: assert } = require('assert');
|
||||
const {
|
||||
withFixtures,
|
||||
defaultGanacheOptions,
|
||||
unlockWallet,
|
||||
} = require('../helpers');
|
||||
const FixtureBuilder = require('../fixture-builder');
|
||||
const { SMART_CONTRACTS } = require('../seeder/smart-contracts');
|
||||
|
||||
describe('Settings', function () {
|
||||
const smartContract = SMART_CONTRACTS.ERC1155;
|
||||
it('Should match the value of token list item and account list item for eth conversion', async function () {
|
||||
await withFixtures(
|
||||
{
|
||||
dapp: true,
|
||||
fixtures: new FixtureBuilder().build(),
|
||||
defaultGanacheOptions,
|
||||
smartContract,
|
||||
title: this.test.title,
|
||||
},
|
||||
async ({ driver }) => {
|
||||
await driver.navigate();
|
||||
await unlockWallet(driver);
|
||||
|
||||
await driver.clickElement('[data-testid="home__asset-tab"]');
|
||||
|
||||
const tokenValue = '0 ETH';
|
||||
const tokenListAmount = await driver.findElement(
|
||||
'[data-testid="multichain-token-list-item-value"]',
|
||||
);
|
||||
assert.equal(await tokenListAmount.getText(), tokenValue);
|
||||
|
||||
await driver.clickElement('[data-testid="account-menu-icon"]');
|
||||
const accountTokenValue = await driver.waitForSelector(
|
||||
'.currency-display-component__text',
|
||||
);
|
||||
|
||||
assert.equal(await accountTokenValue.getText(), '0', `ETH`);
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
it('Should match the value of token list item and account list item for fiat conversion', async function () {
|
||||
await withFixtures(
|
||||
{
|
||||
dapp: true,
|
||||
fixtures: new FixtureBuilder().build(),
|
||||
defaultGanacheOptions,
|
||||
smartContract,
|
||||
title: this.test.title,
|
||||
},
|
||||
async ({ driver }) => {
|
||||
await driver.navigate();
|
||||
await unlockWallet(driver);
|
||||
|
||||
await driver.clickElement(
|
||||
'[data-testid="account-options-menu-button"]',
|
||||
);
|
||||
await driver.clickElement({ text: 'Settings', tag: 'div' });
|
||||
await driver.clickElement({
|
||||
text: 'General',
|
||||
tag: 'div',
|
||||
});
|
||||
await driver.clickElement({ text: 'Fiat', tag: 'label' });
|
||||
|
||||
await driver.clickElement(
|
||||
'.settings-page__header__title-container__close-button',
|
||||
);
|
||||
await driver.clickElement('[data-testid="home__asset-tab"]');
|
||||
const tokenValue = '0 ETH';
|
||||
const tokenListAmount = await driver.findElement(
|
||||
'[data-testid="multichain-token-list-item-value"]',
|
||||
);
|
||||
assert.equal(await tokenListAmount.getText(), tokenValue);
|
||||
|
||||
await driver.clickElement('[data-testid="account-menu-icon"]');
|
||||
const accountTokenValue = await driver.waitForSelector(
|
||||
'.currency-display-component__text',
|
||||
);
|
||||
|
||||
assert.equal(await accountTokenValue.getText(), '0', `ETH`);
|
||||
},
|
||||
);
|
||||
});
|
||||
});
|
@ -194,7 +194,7 @@ export const AccountListItem = ({
|
||||
<UserPreferencedCurrencyDisplay
|
||||
ethNumberOfDecimals={MAXIMUM_CURRENCY_DECIMALS}
|
||||
value={identity.balance}
|
||||
type={SECONDARY}
|
||||
type={PRIMARY}
|
||||
/>
|
||||
</Text>
|
||||
</Box>
|
||||
@ -225,7 +225,7 @@ export const AccountListItem = ({
|
||||
<UserPreferencedCurrencyDisplay
|
||||
ethNumberOfDecimals={MAXIMUM_CURRENCY_DECIMALS}
|
||||
value={identity.balance}
|
||||
type={PRIMARY}
|
||||
type={SECONDARY}
|
||||
/>
|
||||
</Text>
|
||||
</Box>
|
||||
|
Loading…
Reference in New Issue
Block a user