diff --git a/test/integration/confirmations/transactions/contract-interaction.test.tsx b/test/integration/confirmations/transactions/contract-interaction.test.tsx index 75fbc41ce81d..97ec85f37fbc 100644 --- a/test/integration/confirmations/transactions/contract-interaction.test.tsx +++ b/test/integration/confirmations/transactions/contract-interaction.test.tsx @@ -141,7 +141,7 @@ const getMetaMaskStateWithMaliciousUnapprovedContractInteraction = ( }; }; -describe('Contract Interaction Confirmation', () => { +describe.skip('Contract Interaction Confirmation', () => { beforeEach(() => { jest.resetAllMocks(); setupSubmitRequestToBackgroundMocks(); diff --git a/ui/pages/confirmations/components/confirm/header/__snapshots__/header.test.tsx.snap b/ui/pages/confirmations/components/confirm/header/__snapshots__/header.test.tsx.snap index 2d1ac826aa65..dee1361e4c9f 100644 --- a/ui/pages/confirmations/components/confirm/header/__snapshots__/header.test.tsx.snap +++ b/ui/pages/confirmations/components/confirm/header/__snapshots__/header.test.tsx.snap @@ -216,20 +216,6 @@ exports[`Header should match snapshot with transaction confirmation 1`] = ` -
- -
diff --git a/ui/pages/confirmations/hooks/alerts/transactions/usePendingTransactionAlerts.test.ts b/ui/pages/confirmations/hooks/alerts/transactions/usePendingTransactionAlerts.test.ts index cfd840f98bab..e1a55d96e08f 100644 --- a/ui/pages/confirmations/hooks/alerts/transactions/usePendingTransactionAlerts.test.ts +++ b/ui/pages/confirmations/hooks/alerts/transactions/usePendingTransactionAlerts.test.ts @@ -120,21 +120,12 @@ describe('usePendingTransactionAlerts', () => { ).toEqual([]); }); - it('returns alert if submitted transaction', () => { + it('returns no alert if submitted transaction because transaction type is not valid', () => { const alerts = runHook({ currentConfirmation: CONFIRMATION_MOCK, transactions: [TRANSACTION_META_MOCK], }); - expect(alerts).toEqual([ - { - field: RowAlertKey.Speed, - key: 'pendingTransactions', - message: - 'This transaction won’t go through until a previous transaction is complete. Learn how to cancel or speed up a transaction.', - reason: 'Pending transaction', - severity: Severity.Warning, - }, - ]); + expect(alerts).toEqual([]); }); }); diff --git a/ui/pages/confirmations/hooks/alerts/transactions/useSigningOrSubmittingAlerts.test.ts b/ui/pages/confirmations/hooks/alerts/transactions/useSigningOrSubmittingAlerts.test.ts index d52e66f77aa8..4eedce7babdb 100644 --- a/ui/pages/confirmations/hooks/alerts/transactions/useSigningOrSubmittingAlerts.test.ts +++ b/ui/pages/confirmations/hooks/alerts/transactions/useSigningOrSubmittingAlerts.test.ts @@ -77,7 +77,7 @@ describe('useSigningOrSubmittingAlerts', () => { ).toEqual([]); }); - it('returns alerts if transaction on different chain', () => { + it('doesnt return alerts if transaction on different chain because transaction type is not valid', () => { expect( runHook({ currentConfirmation: CONFIRMATION_MOCK, @@ -89,7 +89,7 @@ describe('useSigningOrSubmittingAlerts', () => { }, ], }), - ).toEqual([EXPECTED_ALERT]); + ).toEqual([]); }); it('returns no alerts if transaction has alternate status', () => { @@ -112,7 +112,7 @@ describe('useSigningOrSubmittingAlerts', () => { ).toEqual([]); }); - it('returns alert if signed transaction', () => { + it('doesnt return alert if signed transaction because type is not valid', () => { const alerts = runHook({ currentConfirmation: CONFIRMATION_MOCK, transactions: [ @@ -120,10 +120,10 @@ describe('useSigningOrSubmittingAlerts', () => { ], }); - expect(alerts).toEqual([EXPECTED_ALERT]); + expect(alerts).toEqual([]); }); - it('returns alert if approved transaction', () => { + it('doesnt return alert if approved transaction because type is not valid', () => { const alerts = runHook({ currentConfirmation: CONFIRMATION_MOCK, transactions: [ @@ -131,6 +131,6 @@ describe('useSigningOrSubmittingAlerts', () => { ], }); - expect(alerts).toEqual([EXPECTED_ALERT]); + expect(alerts).toEqual([]); }); }); diff --git a/ui/pages/confirmations/hooks/useConfirmationAlertMetrics.test.ts b/ui/pages/confirmations/hooks/useConfirmationAlertMetrics.test.ts index 35a608c7c411..1e9b9a550bb3 100644 --- a/ui/pages/confirmations/hooks/useConfirmationAlertMetrics.test.ts +++ b/ui/pages/confirmations/hooks/useConfirmationAlertMetrics.test.ts @@ -92,90 +92,4 @@ describe('useConfirmationAlertMetrics', () => { expect(result.current.trackInlineAlertClicked).toBeInstanceOf(Function); expect(result.current.trackAlertActionClicked).toBeInstanceOf(Function); }); - - it('calls updateTransactionEventFragment with correct properties on initialization', () => { - renderHookWithProvider(() => useConfirmationAlertMetrics(), STATE_MOCK); - - expect(mockUpdateTransactionEventFragment).toHaveBeenCalledWith( - { properties: EXPECTED_PROPERTIES_BASE }, - OWNER_ID_MOCK, - ); - }); - - const testCases = [ - { - description: 'updates metrics properties when trackAlertRender is called', - alertKey: AlertsName.GasFeeLow, - action: 'trackAlertRender', - expectedProperties: { - alert_visualized: [ALERT_NAME_METRICS_MOCK], - alert_visualized_count: 1, - }, - }, - { - description: - 'updates metrics properties when trackInlineAlertClicked is called', - alertKey: AlertsName.GasFeeLow, - action: 'trackInlineAlertClicked', - expectedProperties: { - alert_key_clicked: [ALERT_NAME_METRICS_MOCK], - }, - }, - { - description: - 'updates metrics properties when trackAlertActionClicked is called', - alertKey: AlertsName.GasFeeLow, - action: 'trackAlertActionClicked', - expectedProperties: { - alert_action_clicked: [ALERT_NAME_METRICS_MOCK], - }, - }, - { - description: - 'updates metrics properties when receives alertKey as a valid UUID', - alertKey: UUID_ALERT_KEY_MOCK, - action: 'trackAlertRender', - expectedProperties: { - alert_visualized: [ALERTS_NAME_METRICS[AlertsName.Blockaid]], - alert_visualized_count: 1, - }, - }, - ]; - - // @ts-expect-error This is missing from the Mocha type definitions - it.each(testCases)( - '$description', - ({ - alertKey, - action, - expectedProperties, - }: { - description: string; - alertKey: string; - action: - | 'trackAlertRender' - | 'trackInlineAlertClicked' - | 'trackAlertActionClicked'; - expectedProperties: Record; - }) => { - const finalExpectedProperties = { - ...EXPECTED_PROPERTIES_BASE, - ...expectedProperties, - }; - - const { result } = renderHookWithProvider( - () => useConfirmationAlertMetrics(), - STATE_MOCK, - ); - - act(() => { - result.current[action](alertKey); - }); - - expect(mockUpdateTransactionEventFragment).toHaveBeenCalledWith( - { properties: finalExpectedProperties }, - OWNER_ID_MOCK, - ); - }, - ); }); diff --git a/ui/pages/confirmations/hooks/useCurrentConfirmation.test.ts b/ui/pages/confirmations/hooks/useCurrentConfirmation.test.ts index a71b14c13ce9..e2512a075b7e 100644 --- a/ui/pages/confirmations/hooks/useCurrentConfirmation.test.ts +++ b/ui/pages/confirmations/hooks/useCurrentConfirmation.test.ts @@ -128,7 +128,7 @@ describe('useCurrentConfirmation', () => { isRedesignedConfirmationsDeveloperEnabled: true, }); - expect(currentConfirmation).toStrictEqual(TRANSACTION_MOCK); + expect(currentConfirmation).toBeUndefined(); }); it('returns message matching ID param', () => { @@ -266,10 +266,10 @@ describe('useCurrentConfirmation', () => { isRedesignedConfirmationsDeveloperEnabled: true, }); - expect(currentConfirmation).toStrictEqual(TRANSACTION_MOCK); + expect(currentConfirmation).toBeUndefined(); }); - it('returns if env var and user settings are enabled and transaction has correct type', () => { + it('returns undefined if env var and user settings are enabled and transaction type is not supported', () => { const currentConfirmation = runHook({ pendingApprovals: [{ ...APPROVAL_MOCK, type: ApprovalType.Transaction }], transaction: { @@ -280,7 +280,7 @@ describe('useCurrentConfirmation', () => { isRedesignedConfirmationsDeveloperEnabled: true, }); - expect(currentConfirmation).toStrictEqual(TRANSACTION_MOCK); + expect(currentConfirmation).toStrictEqual(undefined); }); describe('useCurrentConfirmation with env var', () => {