(e2e) change accounts to facilitate SIRET and add e2e test

We also add registration ID info to the /me endpoint, via serializers
This commit is contained in:
Laurent Bossavit
2024-12-23 17:09:43 +01:00
committed by Laurent Bossavit
parent 2435a59078
commit 8fd55a61c5
9 changed files with 58 additions and 7 deletions

View File

@@ -0,0 +1,23 @@
import { expect, test } from '@playwright/test';
import { keyCloakSignIn } from './common';
test.beforeEach(async ({ page, browserName }) => {
await page.goto('/');
await keyCloakSignIn(page, browserName, 'marie');
});
test.describe('OIDC interop with SIRET', () => {
test('it checks the SIRET is displayed in /me endpoint', async ({ page }) => {
const header = page.locator('header').first();
await expect(header.getByAltText('Marianne Logo')).toBeVisible();
const response = await page.request.get(
'http://localhost:8071/api/v1.0/users/me/',
);
expect(response.ok()).toBeTruthy();
expect(await response.json()).toMatchObject({
organization: { registration_id_list: ['21580304000017'] },
});
});
});