From c177ff31bb99ad7026145f3ff53128133781c7f8 Mon Sep 17 00:00:00 2001 From: Olusegun Akintayo Date: Tue, 16 Nov 2021 02:04:09 +0400 Subject: [PATCH] addresses an issue found in 10.6.0 QA (#12710) * addresses an issue found in 10.6.0 QA Signed-off-by: Akintayo A. Olusegun * update test cases. Signed-off-by: Akintayo A. Olusegun * Fixes unit test texts to pass Signed-off-by: Akintayo A. Olusegun --- app/_locales/en/messages.json | 8 ++++---- .../confirm-approve-content.component.test.js | 14 +++++++------- ui/pages/confirm-approve/confirm-approve.js | 4 +--- ...-gas-customization-modal.component.test.js.snap | 2 +- ...-gas-customization-modal.container.test.js.snap | 2 +- ...swaps-gas-customization-modal.container.test.js | 2 +- 6 files changed, 15 insertions(+), 17 deletions(-) diff --git a/app/_locales/en/messages.json b/app/_locales/en/messages.json index f97b24f9b..24d6c5a68 100644 --- a/app/_locales/en/messages.json +++ b/app/_locales/en/messages.json @@ -187,7 +187,7 @@ "message": "Approved" }, "approvedAmountWithColon": { - "message": "Approved Amount:" + "message": "Approved amount:" }, "asset": { "message": "Asset" @@ -1066,7 +1066,7 @@ "message": "Goerli Test Network" }, "grantedToWithColon": { - "message": "Granted To:" + "message": "Granted to:" }, "happyToSeeYou": { "message": "We’re happy to see you." @@ -1821,7 +1821,7 @@ "message": "You have approved this permission" }, "permissionRequest": { - "message": "Permission Request" + "message": "Permission request" }, "permissionUncheckedIconDescription": { "message": "You have not approved this permission" @@ -2835,7 +2835,7 @@ "message": "Transaction encountered an error." }, "transactionFee": { - "message": "Transaction Fee" + "message": "Transaction fee" }, "transactionHistoryBaseFee": { "message": "Base Fee (GWEI)" diff --git a/ui/pages/confirm-approve/confirm-approve-content/confirm-approve-content.component.test.js b/ui/pages/confirm-approve/confirm-approve-content/confirm-approve-content.component.test.js index ab3b94b20..162332853 100644 --- a/ui/pages/confirm-approve/confirm-approve-content/confirm-approve-content.component.test.js +++ b/ui/pages/confirm-approve/confirm-approve-content/confirm-approve-content.component.test.js @@ -58,7 +58,7 @@ describe('ConfirmApproveContent Component', () => { const editButtons = getAllByText('Edit'); - expect(queryByText('Transaction Fee')).toBeInTheDocument(); + expect(queryByText('Transaction fee')).toBeInTheDocument(); expect( queryByText('A fee is associated with this request.'), ).toBeInTheDocument(); @@ -72,13 +72,13 @@ describe('ConfirmApproveContent Component', () => { expect(props.showCustomizeNonceModal).toHaveBeenCalledTimes(1); const showHideTxDetails = getByText('View full transaction details'); - expect(queryByText('Permission Request')).not.toBeInTheDocument(); - expect(queryByText('Approved Amount:')).not.toBeInTheDocument(); - expect(queryByText('Granted To:')).not.toBeInTheDocument(); + expect(queryByText('Permission request')).not.toBeInTheDocument(); + expect(queryByText('Approved amount:')).not.toBeInTheDocument(); + expect(queryByText('Granted to:')).not.toBeInTheDocument(); fireEvent.click(showHideTxDetails); - expect(getByText('Permission Request')).toBeInTheDocument(); - expect(getByText('Approved Amount:')).toBeInTheDocument(); - expect(getByText('Granted To:')).toBeInTheDocument(); + expect(getByText('Permission request')).toBeInTheDocument(); + expect(getByText('Approved amount:')).toBeInTheDocument(); + expect(getByText('Granted to:')).toBeInTheDocument(); expect(getByText('0x9bc5...fef4')).toBeInTheDocument(); }); }); diff --git a/ui/pages/confirm-approve/confirm-approve.js b/ui/pages/confirm-approve/confirm-approve.js index dba7c95e2..a0f81be0d 100644 --- a/ui/pages/confirm-approve/confirm-approve.js +++ b/ui/pages/confirm-approve/confirm-approve.js @@ -145,9 +145,7 @@ export default function ConfirmApprove() { }, [checkIfContract]); const { origin } = transaction; - const formattedOrigin = origin - ? origin[0].toUpperCase() + origin.slice(1) - : ''; + const formattedOrigin = origin || ''; const { icon: siteImage = '' } = domainMetadata[origin] || {}; diff --git a/ui/pages/swaps/swaps-gas-customization-modal/__snapshots__/swaps-gas-customization-modal.component.test.js.snap b/ui/pages/swaps/swaps-gas-customization-modal/__snapshots__/swaps-gas-customization-modal.component.test.js.snap index 203c3c916..44ff12529 100644 --- a/ui/pages/swaps/swaps-gas-customization-modal/__snapshots__/swaps-gas-customization-modal.component.test.js.snap +++ b/ui/pages/swaps/swaps-gas-customization-modal/__snapshots__/swaps-gas-customization-modal.component.test.js.snap @@ -107,7 +107,7 @@ exports[`GasCustomizationModalComponent renders the component with initial props