mirror of
https://github.com/pocket-id/pocket-id.git
synced 2026-10-15 06:09:07 +02:00
feat: add ability to force email verification (#1837)
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import { expect, type APIRequestContext } from '@playwright/test';
|
||||
|
||||
// Overrides application configuration values through the API, keeping every other value unchanged
|
||||
// The request context must be authenticated as an admin
|
||||
export async function setAppConfigValues(
|
||||
request: APIRequestContext,
|
||||
values: Record<string, string>
|
||||
) {
|
||||
const configResponse = await request.get('/api/application-configuration/all');
|
||||
expect(configResponse.ok()).toBe(true);
|
||||
|
||||
const config = Object.fromEntries(
|
||||
((await configResponse.json()) as Array<{ key: string; value: string }>).map(
|
||||
({ key, value }) => [key, value]
|
||||
)
|
||||
);
|
||||
|
||||
const updateResponse = await request.put('/api/application-configuration', {
|
||||
data: { ...config, ...values }
|
||||
});
|
||||
expect(updateResponse.ok()).toBe(true);
|
||||
}
|
||||
Reference in New Issue
Block a user