From 914fea1373e6a82ff1228bc802188c36340ea940 Mon Sep 17 00:00:00 2001 From: Charlie Andrews Date: Thu, 12 Oct 2023 18:02:59 -0700 Subject: [PATCH] fix tests --- src/home/ActionsCarousel.test.tsx | 5 +- .../NotificationBox.test.tsx.snap | 167 ------------------ src/home/types.ts | 1 - src/send/Send.test.tsx | 4 - src/send/SendAmount/SendAmount.test.tsx | 3 - src/send/utils.test.ts | 2 - 6 files changed, 2 insertions(+), 180 deletions(-) diff --git a/src/home/ActionsCarousel.test.tsx b/src/home/ActionsCarousel.test.tsx index 4040fec6eb3..8ee56db24a3 100644 --- a/src/home/ActionsCarousel.test.tsx +++ b/src/home/ActionsCarousel.test.tsx @@ -36,7 +36,7 @@ describe('ActionsCarousel', () => { ) - expect(getAllByTestId(/HomeAction-/)).toHaveLength(6) + expect(getAllByTestId(/HomeAction-/)).toHaveLength(5) }) it('does not render swap action when disabled', () => { @@ -47,7 +47,7 @@ describe('ActionsCarousel', () => { ) - expect(getAllByTestId(/HomeAction-/)).toHaveLength(5) + expect(getAllByTestId(/HomeAction-/)).toHaveLength(4) expect(queryByTestId(`HomeAction/Title-Swap`)).toBeFalsy() }) it.each([ @@ -55,7 +55,6 @@ describe('ActionsCarousel', () => { [HomeActionName.Receive, 'receive', Screens.QRNavigator, { screen: Screens.QRCode }], [HomeActionName.Add, 'add', Screens.FiatExchangeCurrency, { flow: FiatExchangeFlow.CashIn }], [HomeActionName.Swap, 'swap', Screens.SwapScreenWithBack, undefined], - [HomeActionName.Request, 'request', Screens.Send, { isOutgoingPaymentRequest: true }], [HomeActionName.Withdraw, 'withdraw', Screens.WithdrawSpend, undefined], ])( 'renders title and navigates to appropriate screen for %s', diff --git a/src/home/__snapshots__/NotificationBox.test.tsx.snap b/src/home/__snapshots__/NotificationBox.test.tsx.snap index ba87ea28a93..cedb8cb0c86 100644 --- a/src/home/__snapshots__/NotificationBox.test.tsx.snap +++ b/src/home/__snapshots__/NotificationBox.test.tsx.snap @@ -222,173 +222,6 @@ exports[`NotificationBox renders correctly for with all notifications 1`] = ` - - - - - - - - - incomingPaymentRequestsSummaryTitle, {"count":2} - - - incomingPaymentRequestsSummaryDetails, {"context":"exactly2Items"} - - - - - viewAll - - - - - - - { await waitFor(() => expect(navigate).toHaveBeenCalledTimes(1)) expect(navigate).toHaveBeenCalledWith(Screens.SendAmount, { recipient: expect.objectContaining(mockRecipient), - isOutgoingPaymentRequest: false, origin: SendOrigin.AppSendFlow, defaultTokenIdOverride: mockCusdTokenId, isFromScan: false, @@ -154,7 +152,6 @@ describe('Send', () => { { await waitFor(() => expect(navigate).toHaveBeenCalledTimes(1)) expect(navigate).toHaveBeenCalledWith(Screens.SendAmount, { recipient: expect.objectContaining(mockRecipient), - isOutgoingPaymentRequest: true, origin: SendOrigin.AppSendFlow, defaultTokenIdOverride: mockCeloTokenId, forceTokenId: true, diff --git a/src/send/SendAmount/SendAmount.test.tsx b/src/send/SendAmount/SendAmount.test.tsx index a7c5de329fa..67fc2a2e4bd 100644 --- a/src/send/SendAmount/SendAmount.test.tsx +++ b/src/send/SendAmount/SendAmount.test.tsx @@ -104,11 +104,9 @@ const mockTransactionData2 = { const mockScreenProps = ({ defaultTokenIdOverride, - isOutgoingPaymentRequest, forceTokenId, }: { defaultTokenIdOverride?: string - isOutgoingPaymentRequest?: boolean forceTokenId?: boolean }) => getMockStackScreenProps(Screens.SendAmount, { @@ -337,7 +335,6 @@ describe('SendAmount', () => { { expect.objectContaining({ origin: SendOrigin.AppSendFlow, recipient: { address: mockData.address, recipientType: RecipientType.Address }, - isOutgoingPaymentRequest: undefined, forceTokenId: true, defaultTokenIdOverride: mockCeurTokenId, }) @@ -84,7 +83,6 @@ describe('send/utils', () => { expect.objectContaining({ origin: SendOrigin.AppSendFlow, recipient: { address: mockData.address, recipientType: RecipientType.Address }, - isOutgoingPaymentRequest: undefined, forceTokenId: false, }) )