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:
@@ -58,10 +58,8 @@ test.describe('Login Flow', () => {
|
||||
await expect(submitButton).toBeEnabled();
|
||||
|
||||
// Submit and wait for navigation to dashboard
|
||||
await Promise.all([
|
||||
page.waitForURL('/dashboard', { timeout: 30000 }),
|
||||
submitButton.click()
|
||||
]);
|
||||
await submitButton.click();
|
||||
await page.waitForURL('/dashboard', { timeout: 30000 });
|
||||
|
||||
// We should be on the dashboard
|
||||
await expect(page).toHaveURL('/dashboard');
|
||||
@@ -365,7 +363,7 @@ test.describe('Login Flow', () => {
|
||||
|
||||
// Should show error (user doesn't exist in this tenant)
|
||||
const errorBanner = page.locator('.error-banner');
|
||||
await expect(errorBanner).toBeVisible({ timeout: 5000 });
|
||||
await expect(errorBanner).toBeVisible({ timeout: 15000 });
|
||||
await expect(errorBanner).toContainText(/email ou .* mot de passe .* incorrect/i);
|
||||
|
||||
// Should still be on login page
|
||||
|
||||
Reference in New Issue
Block a user