feat: Provisionner automatiquement un nouvel établissement
Lorsqu'un super-admin crée un établissement via l'interface, le système doit automatiquement créer la base tenant, exécuter les migrations, créer le premier utilisateur admin et envoyer l'invitation — le tout de manière asynchrone pour ne pas bloquer la réponse HTTP. Ce mécanisme rend chaque établissement opérationnel dès sa création sans intervention manuelle sur l'infrastructure.
This commit is contained in:
@@ -67,10 +67,8 @@ async function loginAsTeacher(page: import('@playwright/test').Page) {
|
||||
await page.goto(`${ALPHA_URL}/login`);
|
||||
await page.locator('#email').fill(TEACHER_EMAIL);
|
||||
await page.locator('#password').fill(TEACHER_PASSWORD);
|
||||
await Promise.all([
|
||||
page.waitForURL(/\/dashboard/, { timeout: 60000 }),
|
||||
page.getByRole('button', { name: /se connecter/i }).click(),
|
||||
]);
|
||||
await page.getByRole('button', { name: /se connecter/i }).click();
|
||||
await page.waitForURL(/\/dashboard/, { timeout: 60000 });
|
||||
}
|
||||
|
||||
|
||||
@@ -297,8 +295,8 @@ test.describe('Homework Exception Request (Story 5.6)', () => {
|
||||
.fill('Justification suffisamment longue pour être valide.');
|
||||
await exceptionDialog.getByRole('button', { name: /créer avec exception/i }).click();
|
||||
|
||||
// Wait for homework to appear
|
||||
await expect(page.getByText('Devoir avec badge')).toBeVisible({ timeout: 10000 });
|
||||
// Wait for homework to appear (Firefox needs more time after exception flow)
|
||||
await expect(page.getByText('Devoir avec badge')).toBeVisible({ timeout: 20000 });
|
||||
|
||||
// Exception badge visible (⚠ Exception text or rule override badge)
|
||||
const card = page.locator('.homework-card', { hasText: 'Devoir avec badge' });
|
||||
|
||||
Reference in New Issue
Block a user