import { fireEvent, render, screen } from '@testing-library/react'; import DashboardReportCtas from '../DashboardReportCtas.tsx'; describe('DashboardReportCtas', () => { it('disables end-cycle until the cycle is closed', () => { const onOpenDaily = vi.fn(); const onOpenEndCycle = vi.fn(); render( ); expect(screen.getByRole('button', { name: /Akhir Siklus/i })).toBeDisabled(); fireEvent.click(screen.getByRole('button', { name: /Harian/i })); expect(onOpenDaily).toHaveBeenCalled(); }); });