1
0
mirror of https://github.com/pocket-id/pocket-id.git synced 2026-02-11 05:59:15 +00:00

refactor: move e2e tests to root of repository

This commit is contained in:
Elias Schneider
2025-05-22 22:02:44 +02:00
parent 5fa15f6098
commit 966a566ade
33 changed files with 1476 additions and 1153 deletions

22
tests/utils/oidc.util.ts Normal file
View File

@@ -0,0 +1,22 @@
import type { Page } from '@playwright/test';
async function getUserCode(page: Page, clientId: string, clientSecret: string) {
const response = await page.request
.post('/api/oidc/device/authorize', {
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
},
form: {
client_id: clientId,
client_secret: clientSecret,
scope: 'openid profile email'
}
})
.then((r) => r.json());
return response.user_code;
}
export default {
getUserCode
};