test: improve frontend test coverage (#163)

- Export DashboardPage helper functions for testability
- Add new test files: App, SharedSchedule, AppContext, UnsavedChangesContext, useUnsavedChangesWarning
- Expand existing test coverage for Auth, MedDetailModal, MobileEditModal, DashboardPage, MedicationsPage, PlannerPage, and more
- Add edge case and error handling tests across components, hooks, and pages
This commit is contained in:
Daniel Volz
2026-02-13 18:34:19 +01:00
committed by GitHub
parent 0b0472f2f5
commit 5c09f97cb3
24 changed files with 4482 additions and 45 deletions
@@ -78,4 +78,14 @@ describe("ExportModal", () => {
fireEvent.click(screen.getByText(/exportImport\.cancelButton/i));
expect(defaultProps.onClose).toHaveBeenCalled();
});
it("does not trigger export actions while exporting", () => {
const { container } = render(<ExportModal {...defaultProps} exporting={true} />);
const actionCards = container.querySelectorAll(".action-card");
fireEvent.click(actionCards[0]);
fireEvent.click(actionCards[1]);
expect(defaultProps.onExport).not.toHaveBeenCalled();
});
});