feat: Provisionner automatiquement un nouvel établissement
Some checks failed
CI / Backend Tests (push) Has been cancelled
CI / Frontend Tests (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
CI / Naming Conventions (push) Has been cancelled
CI / Build Check (push) Has been cancelled

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:
2026-04-08 13:55:41 +02:00
parent bec211ebf0
commit e72867932d
107 changed files with 9709 additions and 383 deletions

View File

@@ -264,14 +264,15 @@ test.describe('Sessions Management', () => {
await login(page, email);
await page.goto(getTenantUrl('/settings'));
await page.waitForLoadState('networkidle');
// Click logout button
const logoutButton = page.getByRole('button', { name: /d[eé]connexion/i });
await expect(logoutButton).toBeVisible();
await logoutButton.click();
// Wait for redirect to login
await expect(page).toHaveURL(/login/, { timeout: 10000 });
await Promise.all([
page.waitForURL(/login/, { timeout: 30000 }),
logoutButton.click()
]);
});
test('logout clears authentication', async ({ page, browserName }, testInfo) => {
@@ -288,8 +289,8 @@ test.describe('Sessions Management', () => {
await expect(logoutButton).toBeVisible();
await logoutButton.click();
// Wait for redirect to login
await expect(page).toHaveURL(/login/, { timeout: 10000 });
// Wait for redirect to login (Firefox can be slow to redirect)
await expect(page).toHaveURL(/login/, { timeout: 20000 });
// Try to access protected page
await page.goto(getTenantUrl('/settings/sessions'));