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);
|
|
|
|
|
|
|
|
await driver.clickElement({ text: 'import tokens', tag: 'a' });
|
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';
|
|
|
|
|
|
|
|
await driver.fill('#custom-address', tokenAddress);
|
|
|
|
await driver.waitForSelector('#custom-symbol-helper-text');
|
|
|
|
await driver.fill('#custom-symbol', tokenSymbol);
|
2022-08-08 21:01:38 +02:00
|
|
|
await driver.clickElement({ text: 'Add custom token', tag: 'button' });
|
|
|
|
await driver.clickElement({ text: 'Import tokens', tag: '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.');
|
|
|
|
},
|
|
|
|
);
|
|
|
|
});
|
|
|
|
});
|