From 04db149724a4566d1bb75d8c7b43844f6be3840f Mon Sep 17 00:00:00 2001 From: Pedro Figueiredo Date: Wed, 11 Sep 2024 10:54:00 +0100 Subject: [PATCH] Tweak e2e test --- .../increase-token-allowance-redesign.spec.ts | 36 ++++++++++++------- 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/test/e2e/tests/confirmations/transactions/increase-token-allowance-redesign.spec.ts b/test/e2e/tests/confirmations/transactions/increase-token-allowance-redesign.spec.ts index 4363d794018f..52dd035d5c97 100644 --- a/test/e2e/tests/confirmations/transactions/increase-token-allowance-redesign.spec.ts +++ b/test/e2e/tests/confirmations/transactions/increase-token-allowance-redesign.spec.ts @@ -8,6 +8,7 @@ import { withFixtures, } from '../../../helpers'; import { Mockttp } from '../../../mock-e2e'; +import GanacheContractAddressRegistry from '../../../seeder/ganache-contract-address-registry'; import { SMART_CONTRACTS } from '../../../seeder/smart-contracts'; import { Driver } from '../../../webdriver/driver'; import { scrollAndConfirmAndAssertConfirm } from '../helpers'; @@ -36,9 +37,11 @@ describe('Confirmation Redesign ERC20 Increase Allowance', function () { title: this.test?.fullTitle(), }, async ({ driver, contractRegistry }: TestSuiteArguments) => { - await openDAppWithContract(driver, contractRegistry, smartContract); - - await createAndAssertIncreaseAllowanceSubmission(driver, '3'); + await createAndAssertIncreaseAllowanceSubmission( + driver, + '3', + contractRegistry, + ); }, ); }); @@ -62,9 +65,11 @@ describe('Confirmation Redesign ERC20 Increase Allowance', function () { title: this.test?.fullTitle(), }, async ({ driver, contractRegistry }: TestSuiteArguments) => { - await openDAppWithContract(driver, contractRegistry, smartContract); - - await createAndAssertIncreaseAllowanceSubmission(driver, '3'); + await createAndAssertIncreaseAllowanceSubmission( + driver, + '3', + contractRegistry, + ); }, ); }); @@ -88,9 +93,11 @@ describe('Confirmation Redesign ERC20 Increase Allowance', function () { title: this.test?.fullTitle(), }, async ({ driver, contractRegistry }: TestSuiteArguments) => { - await openDAppWithContract(driver, contractRegistry, smartContract); - - await createAndAssertIncreaseAllowanceSubmission(driver, '3000'); + await createAndAssertIncreaseAllowanceSubmission( + driver, + '3000', + contractRegistry, + ); }, ); }); @@ -114,9 +121,11 @@ describe('Confirmation Redesign ERC20 Increase Allowance', function () { title: this.test?.fullTitle(), }, async ({ driver, contractRegistry }: TestSuiteArguments) => { - await openDAppWithContract(driver, contractRegistry, smartContract); - - await createAndAssertIncreaseAllowanceSubmission(driver, '3000'); + await createAndAssertIncreaseAllowanceSubmission( + driver, + '3000', + contractRegistry, + ); }, ); }); @@ -157,7 +166,10 @@ describe('Confirmation Redesign ERC20 Increase Allowance', function () { async function createAndAssertIncreaseAllowanceSubmission( driver: Driver, newSpendingCap: string, + contractRegistry?: GanacheContractAddressRegistry, ) { + await openDAppWithContract(driver, contractRegistry, SMART_CONTRACTS.HST); + await createERC20IncreaseAllowanceTransaction(driver); await editSpendingCap(driver, newSpendingCap);