Skip to content

Commit

Permalink
Add better test
Browse files Browse the repository at this point in the history
  • Loading branch information
darkwing committed Feb 20, 2024
1 parent 4beea29 commit bcf86fa
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions test/e2e/tests/account-token-list.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,13 @@ const {
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.fullTitle(),
},
async ({ driver }) => {
Expand All @@ -41,10 +37,8 @@ describe('Settings', function () {
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.fullTitle(),
},
async ({ driver }) => {
Expand All @@ -65,18 +59,16 @@ describe('Settings', function () {
);
await driver.clickElement('[data-testid="home__asset-tab"]');

const tokenValue = '0 ETH';
const tokenListAmount = await driver.findElement(
'[data-testid="multichain-token-list-item-value"]',
'.eth-overview__primary-container',
);
assert.equal(await tokenListAmount.getText(), tokenValue);

assert.equal(await tokenListAmount.getText(), '$0.00\nUSD');
await driver.clickElement('[data-testid="account-menu-icon"]');
const accountTokenValue = await driver.waitForSelector(
'.multichain-account-list-item .multichain-account-list-item__avatar-currency .currency-display-component__text',
'.multichain-account-list-item .multichain-account-list-item__asset',
);

assert.equal(await accountTokenValue.getText(), '0', 'ETH');
assert.equal(await accountTokenValue.getText(), '$0.00USD');
},
);
});
Expand Down

0 comments on commit bcf86fa

Please sign in to comment.