feat: Update event modal UI with header icons and improved actions layout

- Add expand and close icons to ResponsiveDialog header in normal mode
- Change 'Show More' button to 'More options' with Add icon
- Hide Cancel button in normal mode, show only in extended mode
- Add showHeaderActions prop to ResponsiveDialog for UI control
- Preserve EventDisplayPreview modal with old UI (no header icons)
- Update all affected test cases to match new UI behavior
This commit is contained in:
lenhanphung
2025-10-13 14:02:31 +07:00
committed by Benoit TELLIER
parent 4936b89e8b
commit 4c18bf3a52
9 changed files with 141 additions and 17 deletions
@@ -325,9 +325,12 @@ describe("CalendarPopover - Tabs Scenarios", () => {
const input = screen.getByLabelText(/CalDAV access/i);
expect(input).toHaveValue("https://cal.example.org/calendars/user1/cal1");
// Click copy button
const copyButton = screen.getAllByRole("button")[0];
fireEvent.click(copyButton);
// Click copy button (find button containing ContentCopyIcon)
const copyIcon = screen.getByTestId("ContentCopyIcon");
const copyButton = copyIcon.closest("button");
if (copyButton) {
fireEvent.click(copyButton);
}
expect(navigator.clipboard.writeText).toHaveBeenCalledWith(
"https://cal.example.org/calendars/user1/cal1"
+5 -2
View File
@@ -124,10 +124,10 @@ describe("EventPopover", () => {
expect(calendarSelect).toBeInTheDocument();
// Check button
expect(screen.getByText("Show More")).toBeInTheDocument();
expect(screen.getByText("More options")).toBeInTheDocument();
// Extended mode
fireEvent.click(screen.getByText("Show More"));
fireEvent.click(screen.getByText("More options"));
// Back button appears
expect(screen.getByLabelText("show less")).toBeInTheDocument();
@@ -330,6 +330,9 @@ describe("EventPopover", () => {
it("calls onClose when Cancel clicked", () => {
renderPopover();
// Cancel button only appears in expanded mode
fireEvent.click(screen.getByText("More options"));
fireEvent.click(screen.getByText("Cancel"));
expect(mockOnClose).toHaveBeenCalledWith({}, "backdropClick");