Files
console/tests/e2e/helpers/url.ts
Torsten Dittmann cd3dd4db86 test: add journeys
2024-04-17 15:23:07 +02:00

22 lines
538 B
TypeScript

export function getOrganizationIdFromUrl(pathname: string) {
const regex = /\/console\/organization-([^/]+)(\/.*)?/;
const match = pathname.match(regex);
if (match) {
return match[1];
}
throw new Error('Organization ID not found in pathname');
}
export function getProjectIdFromUrl(pathname: string) {
const regex = /\/console\/project-([^/]+)(\/.*)?/;
const match = pathname.match(regex);
if (match) {
return match[1];
}
throw new Error('Project ID not found in pathname');
}