refactor: deduplicate formatters and improve test mocks (#81)
- Consolidate duplicate date formatting utilities - Use shared formatters across backend and frontend - Clean up test mocks to use consistent test data - Remove redundant formatting functions
This commit is contained in:
@@ -14,6 +14,15 @@ vi.mock("react-router-dom", async () => {
|
||||
};
|
||||
});
|
||||
|
||||
// Mock useUnsavedChanges
|
||||
vi.mock("../../context", () => ({
|
||||
useUnsavedChanges: () => ({
|
||||
setHasUnsavedChanges: vi.fn(),
|
||||
hasUnsavedChanges: false,
|
||||
confirmNavigation: vi.fn().mockReturnValue(true),
|
||||
}),
|
||||
}));
|
||||
|
||||
describe("AppHeader", () => {
|
||||
beforeEach(() => {
|
||||
vi.clearAllMocks();
|
||||
|
||||
Reference in New Issue
Block a user