From 54aeb1b791a9818ae825a435553257b6b0787b87 Mon Sep 17 00:00:00 2001 From: Filip Sekulic Date: Tue, 11 Apr 2023 05:19:42 +0200 Subject: [PATCH] Replace contract with third party within the token allowance flow (#18101) --- app/_locales/en/messages.json | 18 +++++++++--------- .../e2e/tests/custom-token-add-approve.spec.js | 6 +++--- test/e2e/tests/signature-request.spec.js | 4 ++-- .../signature-request.component.test.js.snap | 4 ++-- ...firm-approve-content.component.test.js.snap | 8 ++++---- .../confirm-approve-content.component.test.js | 8 ++++---- .../__snapshots__/index.test.js.snap | 2 +- ui/pages/token-allowance/index.scss | 4 ++-- .../token-allowance/token-allowance.test.js | 8 ++++---- 9 files changed, 31 insertions(+), 31 deletions(-) diff --git a/app/_locales/en/messages.json b/app/_locales/en/messages.json index 4766b0221..708197d16 100644 --- a/app/_locales/en/messages.json +++ b/app/_locales/en/messages.json @@ -815,7 +815,7 @@ "message": "Contract deployment" }, "contractDescription": { - "message": "To protect yourself against scammers, take a moment to verify contract details." + "message": "To protect yourself against scammers, take a moment to verify third-party details." }, "contractInteraction": { "message": "Contract interaction" @@ -830,10 +830,10 @@ "message": "Contract requesting signature" }, "contractRequestingSpendingCap": { - "message": "Contract requesting spending cap" + "message": "Third party requesting spending cap" }, "contractTitle": { - "message": "Contract details" + "message": "Third-party details" }, "contractToken": { "message": "Token contract" @@ -1808,14 +1808,14 @@ "message": "Your initial transaction was confirmed by the network. Click OK to go back." }, "inputLogicEmptyState": { - "message": "Only enter a number that you're comfortable with the contract spending now or in the future. You can always increase the spending cap later." + "message": "Only enter a number that you're comfortable with the third party spending now or in the future. You can always increase the spending cap later." }, "inputLogicEqualOrSmallerNumber": { - "message": "This allows the contract to spend $1 from your current balance.", + "message": "This allows the third party to spend $1 from your current balance.", "description": "$1 is the current token balance in the account and the name of the current token" }, "inputLogicHigherNumber": { - "message": "This allows the contract to spend all your token balance until it reaches the cap or you revoke the spending cap. If this is not intended, consider setting a lower spending cap." + "message": "This allows the third party to spend all your token balance until it reaches the cap or you revoke the spending cap. If this is not intended, consider setting a lower spending cap." }, "insightsFromSnap": { "message": "Insights from $1", @@ -3328,7 +3328,7 @@ "description": "$1 is a token symbol" }, "revokeSpendingCapTooltipText": { - "message": "This contract will be unable to spend any more of your current or future tokens." + "message": "This third party will be unable to spend any more of your current or future tokens." }, "rpcUrl": { "message": "New RPC URL" @@ -4660,7 +4660,7 @@ "message": "Username" }, "verifyContractDetails": { - "message": "Verify contract details" + "message": "Verify third-party details" }, "verifyThisTokenDecimalOn": { "message": "Token decimal can be found on $1", @@ -4746,7 +4746,7 @@ "message": "Warning" }, "warningTooltipText": { - "message": "$1 The contract could spend your entire token balance without further notice or consent. Protect yourself by customizing a lower spending cap.", + "message": "$1 The third party could spend your entire token balance without further notice or consent. Protect yourself by customizing a lower spending cap.", "description": "$1 is a warning icon with text 'Be careful' in 'warning' colour" }, "weak": { diff --git a/test/e2e/tests/custom-token-add-approve.spec.js b/test/e2e/tests/custom-token-add-approve.spec.js index b520f1bcf..5e1addcc5 100644 --- a/test/e2e/tests/custom-token-add-approve.spec.js +++ b/test/e2e/tests/custom-token-add-approve.spec.js @@ -119,16 +119,16 @@ describe('Create token, approve token and approve token without gas', function ( ); await driver.clickElement({ - text: 'Verify contract details', + text: 'Verify third-party details', css: '.token-allowance-container__verify-link', }); const modalTitle = await driver.waitForSelector({ - text: 'Contract details', + text: 'Third-party details', tag: 'h5', }); - assert.equal(await modalTitle.getText(), 'Contract details'); + assert.equal(await modalTitle.getText(), 'Third-party details'); await driver.clickElement({ text: 'Got it', diff --git a/test/e2e/tests/signature-request.spec.js b/test/e2e/tests/signature-request.spec.js index 9b508d37b..62ac5cd78 100644 --- a/test/e2e/tests/signature-request.spec.js +++ b/test/e2e/tests/signature-request.spec.js @@ -60,7 +60,7 @@ describe('Sign Typed Data V4 Signature Request', function () { assert.equal(await origin.getText(), 'http://127.0.0.1:8080'); verifyContractDetailsButton.click(); - await driver.findElement({ text: 'Contract details', tag: 'h5' }); + await driver.findElement({ text: 'Third-party details', tag: 'h5' }); await driver.findElement('[data-testid="recipient"]'); await driver.clickElement({ text: 'Got it', tag: 'button' }); @@ -142,7 +142,7 @@ describe('Sign Typed Data V3 Signature Request', function () { assert.equal(await origin.getText(), 'http://127.0.0.1:8080'); verifyContractDetailsButton.click(); - await driver.findElement({ text: 'Contract details', tag: 'h5' }); + await driver.findElement({ text: 'Third-party details', tag: 'h5' }); await driver.findElement('[data-testid="recipient"]'); await driver.clickElement({ text: 'Got it', tag: 'button' }); diff --git a/ui/components/app/signature-request/__snapshots__/signature-request.component.test.js.snap b/ui/components/app/signature-request/__snapshots__/signature-request.component.test.js.snap index d1e6c7708..1892c6ec4 100644 --- a/ui/components/app/signature-request/__snapshots__/signature-request.component.test.js.snap +++ b/ui/components/app/signature-request/__snapshots__/signature-request.component.test.js.snap @@ -224,7 +224,7 @@ exports[`Signature Request Component render should match snapshot when we are us
- Verify contract details + Verify third-party details
@@ -999,7 +999,7 @@ exports[`Signature Request Component render should match snapshot when we want t
- Verify contract details + Verify third-party details
diff --git a/ui/pages/confirm-approve/confirm-approve-content/__snapshots__/confirm-approve-content.component.test.js.snap b/ui/pages/confirm-approve/confirm-approve-content/__snapshots__/confirm-approve-content.component.test.js.snap index e7a265e1a..5d1310891 100644 --- a/ui/pages/confirm-approve/confirm-approve-content/__snapshots__/confirm-approve-content.component.test.js.snap +++ b/ui/pages/confirm-approve/confirm-approve-content/__snapshots__/confirm-approve-content.component.test.js.snap @@ -57,7 +57,7 @@ exports[`ConfirmApproveContent Component should render Confirm approve page corr role="button" tabindex="0" > - Verify contract details + Verify third-party details
- Verify contract details + Verify third-party details
- Verify contract details + Verify third-party details
- Verify contract details + Verify third-party details
{ 'This allows a third party to access and transfer the following NFTs without further notice until you revoke its access.', ), ).toBeInTheDocument(); - expect(queryByText('Verify contract details')).toBeInTheDocument(); + expect(queryByText('Verify third-party details')).toBeInTheDocument(); expect( queryByText( 'We were not able to estimate gas. There might be an error in the contract and this transaction may fail.', @@ -119,7 +119,7 @@ describe('ConfirmApproveContent Component', () => { 'This allows a third party to access and transfer the following NFTs without further notice until you revoke its access.', ), ).toBeInTheDocument(); - expect(queryByText('Verify contract details')).toBeInTheDocument(); + expect(queryByText('Verify third-party details')).toBeInTheDocument(); expect( queryByText( 'We were not able to estimate gas. There might be an error in the contract and this transaction may fail.', @@ -181,7 +181,7 @@ describe('ConfirmApproveContent Component', () => { 'This allows a third party to access and transfer the following NFTs without further notice until you revoke its access.', ), ).toBeInTheDocument(); - expect(queryByText('Verify contract details')).toBeInTheDocument(); + expect(queryByText('Verify third-party details')).toBeInTheDocument(); expect( queryByText( 'We were not able to estimate gas. There might be an error in the contract and this transaction may fail.', @@ -239,7 +239,7 @@ describe('ConfirmApproveContent Component', () => { 'This allows a third party to access and transfer the following NFTs without further notice until you revoke its access.', ), ).toBeInTheDocument(); - expect(queryByText('Verify contract details')).toBeInTheDocument(); + expect(queryByText('Verify third-party details')).toBeInTheDocument(); expect( queryByText( 'We were not able to estimate gas. There might be an error in the contract and this transaction may fail.', diff --git a/ui/pages/confirm-signature-request/__snapshots__/index.test.js.snap b/ui/pages/confirm-signature-request/__snapshots__/index.test.js.snap index fbf3c10c1..ab888b4cf 100644 --- a/ui/pages/confirm-signature-request/__snapshots__/index.test.js.snap +++ b/ui/pages/confirm-signature-request/__snapshots__/index.test.js.snap @@ -223,7 +223,7 @@ exports[`Signature Request Component render should match snapshot 1`] = `
- Verify contract details + Verify third-party details
diff --git a/ui/pages/token-allowance/index.scss b/ui/pages/token-allowance/index.scss index 057be3d10..836625da4 100644 --- a/ui/pages/token-allowance/index.scss +++ b/ui/pages/token-allowance/index.scss @@ -16,8 +16,8 @@ a.token-allowance-container__verify-link { width: fit-content; - margin-inline-start: 96px; - margin-inline-end: 96px; + margin-inline-start: auto; + margin-inline-end: auto; padding: 0; } diff --git a/ui/pages/token-allowance/token-allowance.test.js b/ui/pages/token-allowance/token-allowance.test.js index a438caabb..a8f22dc39 100644 --- a/ui/pages/token-allowance/token-allowance.test.js +++ b/ui/pages/token-allowance/token-allowance.test.js @@ -237,16 +237,16 @@ describe('TokenAllowancePage', () => { expect(getByText('Set a spending cap for your')).toBeInTheDocument(); }); - it('should click Verify contract details and show popup Contract details, then close popup', () => { + it('should click Verify third-party details and show popup Third-party details, then close popup', () => { const { getByText } = renderWithProvider( , store, ); - const verifyContractDetails = getByText('Verify contract details'); - fireEvent.click(verifyContractDetails); + const verifyThirdPartyDetails = getByText('Verify third-party details'); + fireEvent.click(verifyThirdPartyDetails); - expect(getByText('Contract details')).toBeInTheDocument(); + expect(getByText('Third-party details')).toBeInTheDocument(); const gotIt = getByText('Got it'); fireEvent.click(gotIt);