fix calendar and calendar settings e2e test regressions after migration

This commit is contained in:
Gregor Vostrak
2026-03-11 17:46:07 +01:00
parent 97df779d1e
commit 49548037b3
2 changed files with 24 additions and 12 deletions

View File

@@ -215,41 +215,53 @@ test.describe('Calendar Toolbar', () => {
test('prev and next buttons navigate the calendar', async ({ page }) => { test('prev and next buttons navigate the calendar', async ({ page }) => {
await goToCalendar(page); await goToCalendar(page);
const initialTitle = await getCalendarTitle(page).textContent(); // Use column headers to detect navigation (title only shows month which may not change)
const getHeaderTexts = async () => {
const headers = page.locator('.fc-col-header-cell');
return headers.allTextContents();
};
const initialHeaders = await getHeaderTexts();
// Click next // Click next
await page.getByRole('button', { name: 'Next', exact: true }).click(); await page.getByRole('button', { name: 'Next', exact: true }).click();
await expect(page.locator('.fc')).toBeVisible(); await expect(page.locator('.fc')).toBeVisible();
const nextTitle = await getCalendarTitle(page).textContent(); const nextHeaders = await getHeaderTexts();
expect(nextTitle).not.toBe(initialTitle); expect(nextHeaders).not.toEqual(initialHeaders);
// Click prev — should go back to original // Click prev — should go back to original
await page.getByRole('button', { name: 'Previous', exact: true }).click(); await page.getByRole('button', { name: 'Previous', exact: true }).click();
await expect(page.locator('.fc')).toBeVisible(); await expect(page.locator('.fc')).toBeVisible();
const backTitle = await getCalendarTitle(page).textContent(); const backHeaders = await getHeaderTexts();
expect(backTitle).toBe(initialTitle); expect(backHeaders).toEqual(initialHeaders);
}); });
test('today button returns to current week', async ({ page }) => { test('today button returns to current week', async ({ page }) => {
await goToCalendar(page); await goToCalendar(page);
const initialTitle = await getCalendarTitle(page).textContent(); // Use column headers to detect navigation (title only shows month which may not change)
const getHeaderTexts = async () => {
const headers = page.locator('.fc-col-header-cell');
return headers.allTextContents();
};
const initialHeaders = await getHeaderTexts();
// Navigate away // Navigate away
await page.getByRole('button', { name: 'Next', exact: true }).click(); await page.getByRole('button', { name: 'Next', exact: true }).click();
await page.getByRole('button', { name: 'Next', exact: true }).click(); await page.getByRole('button', { name: 'Next', exact: true }).click();
const awayTitle = await getCalendarTitle(page).textContent(); const awayHeaders = await getHeaderTexts();
expect(awayTitle).not.toBe(initialTitle); expect(awayHeaders).not.toEqual(initialHeaders);
// Click today // Click today
await page.getByRole('button', { name: 'today', exact: true }).click(); await page.getByRole('button', { name: 'today', exact: true }).click();
await expect(page.locator('.fc')).toBeVisible(); await expect(page.locator('.fc')).toBeVisible();
const todayTitle = await getCalendarTitle(page).textContent(); const todayHeaders = await getHeaderTexts();
expect(todayTitle).toBe(initialTitle); expect(todayHeaders).toEqual(initialHeaders);
}); });
test('view switcher toggles between week and day views', async ({ page }) => { test('view switcher toggles between week and day views', async ({ page }) => {

View File

@@ -1445,8 +1445,8 @@ test.describe('Resize Events', () => {
await page.mouse.move(centerX, bottomY + slotHeight * 2, { steps: 5 }); await page.mouse.move(centerX, bottomY + slotHeight * 2, { steps: 5 });
await page.mouse.move(targetX!, bottomY + slotHeight * 2, { steps: 15 }); await page.mouse.move(targetX!, bottomY + slotHeight * 2, { steps: 15 });
// Cross-day preview should be visible // Cross-day preview should be visible (may appear in multiple columns)
const preview = page.locator('.fc-cross-day-preview'); const preview = page.locator('.fc-cross-day-preview').first();
await expect(preview).toBeVisible(); await expect(preview).toBeVisible();
await page.mouse.up(); await page.mouse.up();