Date: Tue, 30 Jul 2024 19:06:36 +0300
Subject: [PATCH 4/5] test:fix: snapshots related to permit ellipsis
---
.../info/typed-sign/__snapshots__/typed-sign.test.tsx.snap | 3 ++-
.../__snapshots__/permit-simulation.test.tsx.snap | 2 +-
.../confirmations/confirm/__snapshots__/confirm.test.tsx.snap | 3 ++-
3 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/ui/pages/confirmations/components/confirm/info/typed-sign/__snapshots__/typed-sign.test.tsx.snap b/ui/pages/confirmations/components/confirm/info/typed-sign/__snapshots__/typed-sign.test.tsx.snap
index 67596d6dac2b..3cf251d10584 100644
--- a/ui/pages/confirmations/components/confirm/info/typed-sign/__snapshots__/typed-sign.test.tsx.snap
+++ b/ui/pages/confirmations/components/confirm/info/typed-sign/__snapshots__/typed-sign.test.tsx.snap
@@ -409,7 +409,8 @@ exports[`TypedSignInfo correctly renders permit sign type 1`] = `
tabindex="0"
>
3,000
diff --git a/ui/pages/confirmations/components/confirm/info/typed-sign/permit-simulation/__snapshots__/permit-simulation.test.tsx.snap b/ui/pages/confirmations/components/confirm/info/typed-sign/permit-simulation/__snapshots__/permit-simulation.test.tsx.snap
index 10e985076186..1de065afdbaa 100644
--- a/ui/pages/confirmations/components/confirm/info/typed-sign/permit-simulation/__snapshots__/permit-simulation.test.tsx.snap
+++ b/ui/pages/confirmations/components/confirm/info/typed-sign/permit-simulation/__snapshots__/permit-simulation.test.tsx.snap
@@ -80,7 +80,7 @@ exports[`PermitSimulation renders component correctly 1`] = `
tabindex="0"
>
30
diff --git a/ui/pages/confirmations/confirm/__snapshots__/confirm.test.tsx.snap b/ui/pages/confirmations/confirm/__snapshots__/confirm.test.tsx.snap
index 64eed06931de..9255ae9ba0d4 100644
--- a/ui/pages/confirmations/confirm/__snapshots__/confirm.test.tsx.snap
+++ b/ui/pages/confirmations/confirm/__snapshots__/confirm.test.tsx.snap
@@ -1675,7 +1675,8 @@ exports[`Confirm should match snapshot for signature - typed sign - permit 1`] =
tabindex="0"
>
3,000
From 566166efc55216084ee521739c5de3d980e5bff1 Mon Sep 17 00:00:00 2001
From: digiwand <20778143+digiwand@users.noreply.github.com>
Date: Tue, 30 Jul 2024 19:46:10 +0300
Subject: [PATCH 5/5] chore: rm stale comments
---
ui/components/app/confirm/info/row/text-token-units.test.tsx | 3 ---
ui/components/app/confirm/info/row/text-token-units.tsx | 2 --
2 files changed, 5 deletions(-)
diff --git a/ui/components/app/confirm/info/row/text-token-units.test.tsx b/ui/components/app/confirm/info/row/text-token-units.test.tsx
index 025c5ae8179d..d25b23a52010 100644
--- a/ui/components/app/confirm/info/row/text-token-units.test.tsx
+++ b/ui/components/app/confirm/info/row/text-token-units.test.tsx
@@ -10,7 +10,6 @@ describe('ConfirmInfoRowTextTokenUnits', () => {
,
);
- // Note: using formatAmount loses precision
expect(getByText('0.0123')).toBeInTheDocument();
});
@@ -21,7 +20,6 @@ describe('ConfirmInfoRowTextTokenUnits', () => {
,
);
- // Note: using formatAmount loses precision
expect(getByText('0.3')).toBeInTheDocument();
});
@@ -32,7 +30,6 @@ describe('ConfirmInfoRowTextTokenUnits', () => {
,
);
- // Note: using formatAmount loses precision
expect(getByText('12,346')).toBeInTheDocument();
});
diff --git a/ui/components/app/confirm/info/row/text-token-units.tsx b/ui/components/app/confirm/info/row/text-token-units.tsx
index 610016d8f5d3..bd7fbc52c195 100644
--- a/ui/components/app/confirm/info/row/text-token-units.tsx
+++ b/ui/components/app/confirm/info/row/text-token-units.tsx
@@ -19,8 +19,6 @@ export const ConfirmInfoRowTextTokenUnits: React.FC<
> = ({ value, decimals }) => {
const tokenValue = calcTokenAmount(value, decimals);
- // FIXME - Precision may be lost for large values when using formatAmount
- /** @see {@link https://github.com/MetaMask/metamask-extension/issues/25755} */
const tokenText = formatAmount('en-US', tokenValue);
const tokenTextMaxPrecision = formatAmountMaxPrecision('en-US', tokenValue);