2022-03-09 09:35:14 +01:00
|
|
|
const { strict: assert } = require('assert');
|
|
|
|
const { convertToHexValue, withFixtures } = require('../helpers');
|
2022-10-28 10:42:12 +02:00
|
|
|
const FixtureBuilder = require('../fixture-builder');
|
2022-03-09 09:35:14 +01:00
|
|
|
|
|
|
|
describe('Token Details', function () {
|
|
|
|
const ganacheOptions = {
|
|
|
|
accounts: [
|
|
|
|
{
|
|
|
|
secretKey:
|
|
|
|
'0x7C9529A67102755B7E6102D6D950AC5D5863C98713805CEC576B945B15B71EAC',
|
|
|
|
balance: convertToHexValue(25000000000000000000),
|
|
|
|
},
|
|
|
|
],
|
|
|
|
};
|
|
|
|
it('should show token details for an imported token', async function () {
|
|
|
|
await withFixtures(
|
|
|
|
{
|
2022-10-28 10:42:12 +02:00
|
|
|
fixtures: new FixtureBuilder().build(),
|
2022-03-09 09:35:14 +01:00
|
|
|
ganacheOptions,
|
|
|
|
title: this.test.title,
|
|
|
|
},
|
|
|
|
async ({ driver }) => {
|
|
|
|
await driver.navigate();
|
|
|
|
await driver.fill('#password', 'correct horse battery staple');
|
|
|
|
await driver.press('#password', driver.Key.ENTER);
|
|
|
|
|
2023-06-01 23:14:38 +02:00
|
|
|
await driver.clickElement({ text: 'Import tokens', tag: 'button' });
|
2022-08-08 21:01:38 +02:00
|
|
|
await driver.clickElement({ text: 'Custom token', tag: 'button' });
|
2022-03-09 09:35:14 +01:00
|
|
|
|
|
|
|
const tokenAddress = '0x2EFA2Cb29C2341d8E5Ba7D3262C9e9d6f1Bf3711';
|
|
|
|
const tokenSymbol = 'AAVE';
|
|
|
|
|
2023-08-14 18:08:59 +02:00
|
|
|
await driver.fill(
|
|
|
|
'[data-testid="import-tokens-modal-custom-address"]',
|
|
|
|
tokenAddress,
|
|
|
|
);
|
|
|
|
await driver.waitForSelector('p.mm-box--color-error-default');
|
|
|
|
await driver.fill(
|
|
|
|
'[data-testid="import-tokens-modal-custom-symbol"]',
|
|
|
|
tokenSymbol,
|
|
|
|
);
|
|
|
|
await driver.clickElement({ text: 'Next', tag: 'button' });
|
|
|
|
await driver.clickElement(
|
|
|
|
'[data-testid="import-tokens-modal-import-button"]',
|
|
|
|
);
|
2023-02-15 15:39:46 +01:00
|
|
|
await driver.clickElement('[aria-label="Asset options"]');
|
2023-02-21 16:50:54 +01:00
|
|
|
await driver.clickElement({ text: 'Token details', tag: 'div' });
|
2022-03-09 09:35:14 +01:00
|
|
|
|
|
|
|
const tokenAddressFound = {
|
|
|
|
text: tokenAddress,
|
|
|
|
};
|
|
|
|
|
|
|
|
const exists = await driver.isElementPresent(tokenAddressFound);
|
|
|
|
|
|
|
|
assert.ok(exists, 'Token details are not correct.');
|
|
|
|
},
|
|
|
|
);
|
|
|
|
});
|
|
|
|
});
|