mirror of
https://github.com/pocket-id/pocket-id.git
synced 2026-10-28 03:29:08 +01:00
feat!: replace custom claims with custom fields
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import test, { expect } from '@playwright/test';
|
||||
import { customFields } from 'data';
|
||||
import { cleanupBackend } from '../utils/cleanup.util';
|
||||
|
||||
test.beforeEach(async () => await cleanupBackend());
|
||||
@@ -12,7 +13,8 @@ test.describe('LDAP Integration', () => {
|
||||
test('LDAP configuration is working properly', async ({ page }) => {
|
||||
await page.goto('/settings/admin/application-configuration');
|
||||
|
||||
await page.getByRole('button', { name: 'Expand card' }).nth(3).click();
|
||||
await page.getByRole('tab', { name: 'Users and groups' }).click();
|
||||
await page.getByRole('button', { name: 'Expand card' }).nth(2).click();
|
||||
|
||||
await expect(page.getByRole('button', { name: 'Disable', exact: true })).toBeVisible();
|
||||
await expect(page.getByLabel('LDAP URL')).toHaveValue(/ldap:\/\/.*/);
|
||||
@@ -66,6 +68,25 @@ test.describe('LDAP Integration', () => {
|
||||
await expect(page.getByText('LDAP').first()).toBeVisible();
|
||||
});
|
||||
|
||||
test('LDAP custom fields are synced into users and groups', async ({ page }) => {
|
||||
await page.goto('/settings/admin/users');
|
||||
await page.getByRole('row', { name: 'testuser1' }).getByRole('button').click();
|
||||
await page.getByRole('menuitem', { name: 'Edit' }).click();
|
||||
|
||||
await expect(page.getByLabel(customFields.department.displayName)).toHaveValue('Engineering');
|
||||
|
||||
await page.goto('/settings/admin/user-groups');
|
||||
await page
|
||||
.getByRole('row', { name: 'admin_group' })
|
||||
.getByRole('button', { name: 'Toggle menu' })
|
||||
.click();
|
||||
await page.getByRole('menuitem', { name: 'Edit' }).click();
|
||||
|
||||
await expect(
|
||||
page.getByRole('switch', { name: customFields.elevatedRights.displayName })
|
||||
).toBeChecked();
|
||||
});
|
||||
|
||||
test('LDAP users cannot be modified in PocketID', async ({ page }) => {
|
||||
// Navigate to LDAP user details
|
||||
await page.goto('/settings/admin/users');
|
||||
|
||||
Reference in New Issue
Block a user