diff --git a/src/app/(app)/ledger/close/__tests__/ChangedTransactionsPanel.test.tsx b/src/app/(app)/ledger/close/__tests__/ChangedTransactionsPanel.test.tsx new file mode 100644 index 0000000..0ff6459 --- /dev/null +++ b/src/app/(app)/ledger/close/__tests__/ChangedTransactionsPanel.test.tsx @@ -0,0 +1,491 @@ +import { fireEvent, render, screen, waitFor } from '@testing-library/react' +import { beforeEach, describe, expect, it, vi } from 'vitest' + +const mockListEventBlocks = vi.fn() +const mockPreviewReconcilingItem = vi.fn() +const mockResolveReconcilingItem = vi.fn() + +vi.mock('@robosystems/core', () => ({ + clients: { + ledger: { + listEventBlocks: (...args: any[]) => mockListEventBlocks(...args), + previewReconcilingItem: (...args: any[]) => + mockPreviewReconcilingItem(...args), + resolveReconcilingItem: (...args: any[]) => + mockResolveReconcilingItem(...args), + }, + }, + LoadingState: () => ( +
+ Loading +
+ ), +})) + +vi.mock('flowbite-react', () => ({ + Button: ({ children, onClick, disabled }: any) => ( + + ), + Label: ({ children, htmlFor }: any) => ( + + ), + Spinner: () => , + Table: ({ children }: any) => {children}
, + TableBody: ({ children }: any) => {children}, + TableCell: ({ children }: any) => {children}, + TableHead: ({ children }: any) => {children}, + TableHeadCell: ({ children }: any) => {children}, + TableRow: ({ children }: any) => {children}, + Textarea: ({ value, onChange, id }: any) => ( +