first commit

This commit is contained in:
Alberto-Audrix committed 2026-09-08 15:21:23 +07:00
commit b54624be96
226 files changed
+108840

No files matched your search

@@ -0,0 +1,21 @@
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(
<DashboardReportCtas
cycleClosed={false}
hasDailySnapshot={false}
hasEndCycleSnapshot={false}
onOpenDaily={onOpenDaily}
onOpenEndCycle={onOpenEndCycle}
/>
);
expect(screen.getByRole('button', { name: /Akhir Siklus/i })).toBeDisabled();
fireEvent.click(screen.getByRole('button', { name: /Harian/i }));
expect(onOpenDaily).toHaveBeenCalled();
});
});