mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-24 19:10:22 +01:00
4c37448c97
* added ipfs toggle * added placeholder valur * fixed snapshot * updated tests * updated spec file * hide input if toggle is disabled * updated e2e tests for nft image * fixed view-ercc-1155 spec * updated e2e tests for nfts * added ipfs toggle modal * updated UI for ipfs * updated tests * updated classname * added placeholder image * lint fix * removed prop ipfsEnabled and used with selector * fixed ui for ipfs toggle * updated test * updated test to handle cases * nit fix * ensure default image height match nft image
55 lines
1.9 KiB
JavaScript
55 lines
1.9 KiB
JavaScript
const { strict: assert } = require('assert');
|
|
const { convertToHexValue, withFixtures } = require('../helpers');
|
|
const { SMART_CONTRACTS } = require('../seeder/smart-contracts');
|
|
const FixtureBuilder = require('../fixture-builder');
|
|
|
|
describe('Remove NFT', function () {
|
|
const smartContract = SMART_CONTRACTS.NFTS;
|
|
const ganacheOptions = {
|
|
accounts: [
|
|
{
|
|
secretKey:
|
|
'0x7C9529A67102755B7E6102D6D950AC5D5863C98713805CEC576B945B15B71EAC',
|
|
balance: convertToHexValue(25000000000000000000),
|
|
},
|
|
],
|
|
};
|
|
|
|
it('user should be able to remove ERC721 NFT on details page', async function () {
|
|
await withFixtures(
|
|
{
|
|
dapp: true,
|
|
fixtures: new FixtureBuilder().withNftControllerERC721().build(),
|
|
ganacheOptions,
|
|
smartContract,
|
|
title: this.test.title,
|
|
},
|
|
async ({ driver }) => {
|
|
await driver.navigate();
|
|
await driver.fill('#password', 'correct horse battery staple');
|
|
await driver.press('#password', driver.Key.ENTER);
|
|
|
|
// Open the details and click remove nft button
|
|
await driver.clickElement('[data-testid="home__nfts-tab"]');
|
|
await driver.clickElement('.nft-item__container');
|
|
await driver.clickElement('[data-testid="nft-options__button"]');
|
|
await driver.clickElement('[data-testid="nft-item-remove"]');
|
|
|
|
// Check the remove NFT toaster is displayed
|
|
const removeNftNotification = await driver.findElement({
|
|
text: 'NFT was successfully removed!',
|
|
tag: 'h6',
|
|
});
|
|
assert.equal(await removeNftNotification.isDisplayed(), true);
|
|
|
|
// Check the imported NFT disappeared in the NFT tab
|
|
const noNftInfo = await driver.waitForSelector({
|
|
css: 'h4',
|
|
text: 'No NFTs yet',
|
|
});
|
|
assert.equal(await noNftInfo.isDisplayed(), true);
|
|
},
|
|
);
|
|
});
|
|
});
|