Skip to content

Commit d79002a

Browse files
committedMar 25, 2025
test(e2e): add test scenarion to join an organization
1 parent 7ba1a4a commit d79002a

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed
 
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import { expect } from '@playwright/test';
2+
3+
import { databaseBuilder } from '../helpers/db.ts';
4+
import { test } from '../helpers/fixtures.ts';
5+
6+
let invitation: { id: string; code: string };
7+
const email = 'admin@example.net';
8+
9+
test.beforeEach(async function () {
10+
invitation = databaseBuilder.factory.buildOrganizationInvitation({
11+
email,
12+
});
13+
await databaseBuilder.commit();
14+
});
15+
16+
test('Join an organization without having an account', async function ({ page }) {
17+
await page.goto(`/rejoindre?invitationId=${invitation.id}&code=${invitation.code}`);
18+
await expect(page.getByText('Vous êtes invité(e) à')).toBeVisible();
19+
await page.getByRole('textbox', { name: 'Prénom' }).fill('mini');
20+
await page.getByRole('textbox', { name: 'Nom', exact: true }).fill('pixou');
21+
await page.getByRole('textbox', { name: 'Adresse e-mail' }).fill('minipixou@example.net');
22+
await page.getByRole('textbox', { name: 'Mot de passe' }).fill('Azerty123*');
23+
await page.getByRole('checkbox', { name: "Accepter les conditions d'" }).check();
24+
await page.getByRole('button', { name: "Je m'inscris" }).click();
25+
await page.getByRole('heading', { name: "Veuillez accepter nos Conditions Générales d'Utilisation" }).waitFor();
26+
await page.getByRole('button', { name: 'Accepter et continuer' }).click();
27+
await expect(page.getByRole('heading', { name: 'Campagnes' })).toBeVisible();
28+
await expect(page.getByText('Aucune campagne, pour')).toBeVisible();
29+
});

0 commit comments

Comments
 (0)