From afd2741e269d15c30125100cdf4c9c916a4a09ca Mon Sep 17 00:00:00 2001 From: Paul Cramer Date: Tue, 16 Jul 2024 16:59:12 -0700 Subject: [PATCH] Add transactionStatusAction --- .../TransactionStatusAction.test.tsx | 22 +++++++++++++++++++ .../TransactionStatusLabel.test.tsx | 2 +- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/transaction/components/TransactionStatusAction.test.tsx b/src/transaction/components/TransactionStatusAction.test.tsx index e69de29bb2..c4992a9fe7 100644 --- a/src/transaction/components/TransactionStatusAction.test.tsx +++ b/src/transaction/components/TransactionStatusAction.test.tsx @@ -0,0 +1,22 @@ +import { render, screen } from '@testing-library/react'; +import { describe, it, expect, vi } from 'vitest'; +import { TransactionStatusAction } from './TransactionStatusAction'; +import { useGetTransactionStatus } from '../core/useGetTransactionStatus'; + +vi.mock('../core/useGetTransactionStatus', () => ({ + useGetTransactionStatus: vi.fn(), +})); + +describe('TransactionStatusAction', () => { + it('renders transaction status action', () => { + (useGetTransactionStatus as vi.Mock).mockReturnValue({ + actionElement: , + }); + + render(); + + const actionElement = screen.getByText('Retry'); + expect(actionElement).toBeInTheDocument(); + expect(actionElement.tagName).toBe('BUTTON'); + }); +}); diff --git a/src/transaction/components/TransactionStatusLabel.test.tsx b/src/transaction/components/TransactionStatusLabel.test.tsx index 7bce8d10d0..b532e82f50 100644 --- a/src/transaction/components/TransactionStatusLabel.test.tsx +++ b/src/transaction/components/TransactionStatusLabel.test.tsx @@ -20,4 +20,4 @@ describe('TransactionStatusLabel', () => { expect(label).toBeInTheDocument(); expect(label).toHaveClass('text-foreground-muted'); }); -}); +}); \ No newline at end of file