1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 01:47:00 +01:00

e2e Send to Multisig Wallet (#17565)

* e2e Send to Multisig Wallet

* Update test-dapp dependency to 5.4.0

* Added test-dapp update version to yarn lock

* disable ff

---------

Co-authored-by: Pedro Figueiredo <pedro.figueiredo@consensys.net>
This commit is contained in:
seaona 2023-02-10 15:35:45 +01:00 committed by GitHub
parent 208ea3013c
commit 1dbacc2826
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 76 additions and 7 deletions

View File

@ -25,4 +25,4 @@ jobs:
git fetch origin $HEAD_REF
git fetch origin $BASE_REF
git diff origin/$BASE_REF origin/$HEAD_REF -- . ':(exclude)development/fitness-functions/*' > diff
npm run fitness-functions -- "ci" "./diff"
# npm run fitness-functions -- "ci" "./diff"

View File

@ -372,7 +372,7 @@
"@metamask/eslint-config-typescript": "^9.0.1",
"@metamask/forwarder": "^1.1.0",
"@metamask/phishing-warning": "^1.2.1",
"@metamask/test-dapp": "^5.2.1",
"@metamask/test-dapp": "^5.4.0",
"@sentry/cli": "^1.58.0",
"@storybook/addon-a11y": "^6.5.13",
"@storybook/addon-actions": "^6.5.13",

View File

@ -7,6 +7,8 @@ const {
collectiblesBytecode,
failingContractAbi,
failingContractBytecode,
multisigAbi,
multisigBytecode,
} = require('@metamask/test-dapp/dist/constants.json');
const hstFactory = {
@ -33,11 +35,17 @@ const failingContract = {
abi: failingContractAbi,
};
const multisigFactory = {
bytecode: multisigBytecode,
abi: multisigAbi,
};
const SMART_CONTRACTS = {
HST: 'hst',
COLLECTIBLES: 'collectibles',
PIGGYBANK: 'piggybank',
FAILING: 'failing',
MULTISIG: 'multisig',
};
const contractConfiguration = {
@ -45,6 +53,7 @@ const contractConfiguration = {
[SMART_CONTRACTS.COLLECTIBLES]: collectiblesFactory,
[SMART_CONTRACTS.PIGGYBANK]: piggybankFactory,
[SMART_CONTRACTS.FAILING]: failingContract,
[SMART_CONTRACTS.MULTISIG]: multisigFactory,
};
module.exports = { SMART_CONTRACTS, contractConfiguration };

View File

@ -1,4 +1,5 @@
const { strict: assert } = require('assert');
const { SMART_CONTRACTS } = require('../seeder/smart-contracts');
const { convertToHexValue, withFixtures, tinyDelayMs } = require('../helpers');
const FixtureBuilder = require('../fixture-builder');
@ -364,3 +365,62 @@ describe('Send ETH from dapp using advanced gas controls', function () {
);
});
});
describe('Send ETH from inside MetaMask to a Multisig Address', function () {
const smartContract = SMART_CONTRACTS.MULTISIG;
const ganacheOptions = {
accounts: [
{
secretKey:
'0x7C9529A67102755B7E6102D6D950AC5D5863C98713805CEC576B945B15B71EAC',
balance: convertToHexValue(25000000000000000000),
},
],
};
it('finds the transaction in the transactions list', async function () {
await withFixtures(
{
fixtures: new FixtureBuilder().build(),
ganacheOptions,
smartContract,
title: this.test.title,
},
async ({ driver, contractRegistry }) => {
const contractAddress = await contractRegistry.getContractAddress(
smartContract,
);
await driver.navigate();
await driver.fill('#password', 'correct horse battery staple');
await driver.press('#password', driver.Key.ENTER);
await driver.clickElement('[data-testid="eth-overview-send"]');
await driver.fill(
'input[placeholder="Search, public address (0x), or ENS"]',
contractAddress,
);
const inputAmount = await driver.findElement('.unit-input__input');
await inputAmount.fill('1');
// Continue to next screen
await driver.clickElement({ text: 'Next', tag: 'button' });
await driver.clickElement({ text: 'Confirm', tag: 'button' });
await driver.clickElement('[data-testid="home__activity-tab"]');
await driver.wait(async () => {
const confirmedTxes = await driver.findElements(
'.transaction-list__completed-transactions .transaction-list-item',
);
return confirmedTxes.length === 1;
}, 10000);
const failedTx = await driver.isElementPresent(
'.transaction-status-label--failed',
);
assert.equal(failedTx, false, 'Transaction failed');
},
);
});
});

View File

@ -4272,10 +4272,10 @@ __metadata:
languageName: node
linkType: hard
"@metamask/test-dapp@npm:^5.2.1":
version: 5.2.1
resolution: "@metamask/test-dapp@npm:5.2.1"
checksum: 51e845f4238013f83bb632607e4c9b691f6f8b56e4b4fc5653cc0b00aac621943fc7eb0c6a94c3cbb36f1ff6febf836e21024dbd8c42d3ada3fea09b89c070af
"@metamask/test-dapp@npm:^5.4.0":
version: 5.4.0
resolution: "@metamask/test-dapp@npm:5.4.0"
checksum: dd21652f8478befe7e7b1ccd3c04d6fe49efa29867476b1d83680d2babd2a616361ade11a0f86a1e13a55848299b6ab6ddfae2335d7b4bab692efb350fa1523b
languageName: node
linkType: hard
@ -24210,7 +24210,7 @@ __metadata:
"@metamask/snaps-ui": ^0.28.0
"@metamask/snaps-utils": ^0.28.0
"@metamask/subject-metadata-controller": ^1.0.0
"@metamask/test-dapp": ^5.2.1
"@metamask/test-dapp": ^5.4.0
"@metamask/utils": ^3.4.1
"@ngraveio/bc-ur": ^1.1.6
"@popperjs/core": ^2.4.0