✨(plugin) add CommuneCreation plugin
Add E2E test to cover the API integration, access grant &c.
This commit is contained in:
committed by
Laurent Bossavit
parent
471f69d4ec
commit
a68f8171cb
@@ -250,7 +250,7 @@ class CommuneCreation(BaseOrganizationPlugin):
|
||||
zone_name = orga.name.lower() + ".collectivite.fr"
|
||||
|
||||
try:
|
||||
domain = MailDomain.objects.get(domain=zone_name)
|
||||
domain = MailDomain.objects.get(name=zone_name)
|
||||
except MailDomain.DoesNotExist:
|
||||
domain = None
|
||||
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
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('When a commune, domain is created on first login via ProConnect', () => {
|
||||
test('it checks the domain has been created', async ({ page }) => {
|
||||
const header = page.locator('header').first();
|
||||
await expect(header.getByAltText('Marianne Logo')).toBeVisible();
|
||||
|
||||
await page
|
||||
.locator('menu')
|
||||
.first()
|
||||
.getByLabel(`Mail Domains button`)
|
||||
.click();
|
||||
await expect(page).toHaveURL(/mail-domains\//);
|
||||
await expect(
|
||||
page.getByLabel('Mail domains panel', { exact: true }),
|
||||
).toBeVisible();
|
||||
await expect(page.getByText('merlaut.collectivite.fr')).toHaveCount(1);
|
||||
await expect(page.getByText('No domains exist.')).toHaveCount(0);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user