pp-planer/tests/e2e/service-edit-sermon.spec.ts

42 lines
1.4 KiB
TypeScript

import { test, expect } from '@playwright/test';
async function navigateToEditPage(page) {
await page.goto('/services');
await page.waitForLoadState('networkidle');
const editButton = page.getByTestId('service-list-edit-button').first();
const hasEditableService = await editButton.isVisible().catch(() => false);
if (!hasEditableService) {
return false;
}
await editButton.click();
await page.waitForLoadState('networkidle');
return true;
}
test('navigate to first editable service edit page', async ({ page }) => {
const navigated = await navigateToEditPage(page);
if (!navigated) {
test.skip();
}
await expect(page).toHaveURL(/.*services\/\d+\/edit/);
const agendaSection = page.getByTestId('agenda-section');
const emptyState = page.getByText('Keine Ablauf-Elemente vorhanden');
const hasAgenda = await agendaSection.isVisible().catch(() => false);
const hasEmptyState = await emptyState.isVisible().catch(() => false);
expect(hasAgenda || hasEmptyState).toBe(true);
});
test.skip('sermon block accordion — replaced by agenda view', async () => {});
test.skip('sermon upload area — replaced by agenda item slide uploader', async () => {});
test.skip('existing sermon slides as thumbnails — replaced by agenda item slides', async () => {});
test.skip('delete button on sermon slide — replaced by agenda item slides', async () => {});