feat(events): align Update modal with Create; extract shared form fields

- ux: close Update modal immediately on Save; run API in background
- fix: remove stale single-instance when converting to repeating
- test: adjust EventDisplay expectations
- refactor: share form via components/Event/EventFormFields (used by Create/Update)
This commit is contained in:
lenhanphung
2025-10-06 17:28:49 +07:00
committed by Benoit TELLIER
parent 770257c03b
commit 42c953ccf9
9 changed files with 2129 additions and 731 deletions
+2 -3
View File
@@ -14,7 +14,6 @@ const baseRepetition: RepetitionObject = {
interval: 1,
occurrences: 0,
endDate: "",
selectedDays: [],
};
const mockOnClose = jest.fn();
@@ -188,7 +187,7 @@ describe("RepeatEvent Component", () => {
fireEvent.click(mondayCheckbox);
expect(setRepetition).toHaveBeenCalledWith(
expect.objectContaining({ selectedDays: ["MO"] })
expect.objectContaining({ byday: ["MO"] })
);
});
});
@@ -270,7 +269,7 @@ describe("Repeat Event Integration Tests", () => {
await expectRRule({
freq: "weekly",
interval: 1,
selectedDays: ["FR", "TH"],
byday: ["FR", "TH"],
});
expect(mockOnClose).toHaveBeenCalledWith({}, "backdropClick");
});