mirror of
https://github.com/bulwarkmail/webmail.git
synced 2026-11-05 16:16:49 +00:00
test: open calendar delete and clear from the row's ⋮ in the settings tests
The settings pass tested the hover icons for delete, clear and edit; pim-20 replaced them with one Edit… button and a ⋮ menu, so the tests now go through those.
This commit is contained in:
@@ -92,7 +92,9 @@ describe('deleting a calendar and clearing its events', () => {
|
||||
|
||||
it('confirms a delete in a dialog, not an inline strip', async () => {
|
||||
render(<CalendarManagementSettings />);
|
||||
fireEvent.click(screen.getByTitle('delete'));
|
||||
// Delete and clear live in the row's ⋮ since pim-20.
|
||||
fireEvent.click(screen.getByRole('button', { name: 'row_actions' }));
|
||||
fireEvent.click(screen.getByRole('menuitem', { name: 'delete_calendar' }));
|
||||
expect(confirmDialog().getByText('delete_title')).toBeTruthy();
|
||||
fireEvent.click(confirmDialog().getByRole('button', { name: 'delete' }));
|
||||
await waitFor(() => expect(removeCalendar).toHaveBeenCalledWith(expect.anything(), 'work'));
|
||||
@@ -100,7 +102,8 @@ describe('deleting a calendar and clearing its events', () => {
|
||||
|
||||
it('confirms clearing the events in a dialog', async () => {
|
||||
render(<CalendarManagementSettings />);
|
||||
fireEvent.click(screen.getByTitle('clear_events'));
|
||||
fireEvent.click(screen.getByRole('button', { name: 'row_actions' }));
|
||||
fireEvent.click(screen.getByRole('menuitem', { name: 'clear_all_events' }));
|
||||
expect(confirmDialog().getByText('clear_title')).toBeTruthy();
|
||||
fireEvent.click(confirmDialog().getByRole('button', { name: 'clear_events' }));
|
||||
await waitFor(() => expect(clearCalendarEvents).toHaveBeenCalledWith(expect.anything(), 'work'));
|
||||
|
||||
@@ -50,7 +50,12 @@ describe('settings row actions on touch and keyboard', () => {
|
||||
icalSubscriptions: [],
|
||||
} as never);
|
||||
render(<CalendarManagementSettings />);
|
||||
expectReachable(screen.getByTitle('edit'));
|
||||
// No hover icons since pim-20: Edit… and the ⋮ are always shown.
|
||||
for (const name of ['edit_calendar', 'row_actions']) {
|
||||
const button = screen.getByRole('button', { name });
|
||||
expect(button.className).not.toContain('opacity-0');
|
||||
expect((button.parentElement as HTMLElement).className).not.toContain('opacity-0');
|
||||
}
|
||||
});
|
||||
|
||||
it('address books', () => {
|
||||
|
||||
Reference in New Issue
Block a user