- Dockerfile: Update binary name from attendance to tutortool to fix the release build pipeline failure. - Backend: Expose test_mode in AppState to conditionally disable the secure flag on auth cookies during local E2E testing over HTTP. - Backend: Enable tower-http trace feature and attach TraceLayer for improved request logging. - Frontend: Refactor auth.svelte.ts to a plain reactive object to resolve initialization race conditions during tests. - Frontend: Append cache-busting timestamp to /api/auth/me to prevent stale session states. - Frontend: Update Playwright locator in superadmin.spec.ts for greater resilience. - Makefile: Inject required environment variables (STATIC_DIR, JWT_SECRET) into the test-up target.
41 lines
1.5 KiB
TypeScript
41 lines
1.5 KiB
TypeScript
import { test, expect } from './fixtures';
|
|
|
|
test.describe('Superadmin CRUD & UI Consistency', () => {
|
|
test('should show superadmin navigation and theme consistency', async ({ page }) => {
|
|
await page.goto('/admin');
|
|
|
|
const tutorsLink = page.locator('nav >> text=Tutor:innen');
|
|
await expect(tutorsLink).toBeVisible();
|
|
|
|
const mainContainer = page.locator('.paper-bg');
|
|
await expect(mainContainer).toBeVisible();
|
|
|
|
const header = page.locator('.serif').first();
|
|
await expect(header).toBeVisible();
|
|
const fontFamily = await header.evaluate(el => window.getComputedStyle(el).fontFamily);
|
|
expect(fontFamily).toContain('Source Serif');
|
|
});
|
|
|
|
test('should allow superadmin to navigate to tutors and see the list', async ({ page }) => {
|
|
await page.goto('/admin');
|
|
await page.click('nav >> text=Tutor:innen');
|
|
await expect(page).toHaveURL(/\/admin\/tutors/);
|
|
|
|
const tableHeader = page.locator('th >> text=Name / E-Mail');
|
|
await expect(tableHeader).toBeVisible();
|
|
|
|
await expect(page.locator('text=Demo Admin')).toBeVisible();
|
|
});
|
|
|
|
test('should allow superadmin to see course assignment UI', async ({ page }) => {
|
|
await page.goto('/admin');
|
|
await page.click('nav >> text=Kurse');
|
|
await expect(page).toHaveURL(/\/admin\/courses/);
|
|
|
|
await expect(page.locator('text=Neuen Kurs anlegen')).toBeVisible();
|
|
|
|
const tutorSelect = page.locator('select.tiny').first();
|
|
await expect(tutorSelect).toBeVisible();
|
|
});
|
|
});
|