keycloak-scim/js/apps/account-ui/test/utils.ts
Hynek Mlnařík 250e1137d6
Fix account console tests for dev (#27600)
Fixes: #27604

Signed-off-by: Hynek Mlnarik <hmlnarik@redhat.com>
2024-03-07 12:39:26 +01:00

18 lines
592 B
TypeScript

import { getRootPath } from "../src/utils/getRootPath";
function getTestServerUrl(): string {
return process.env.KEYCLOAK_SERVER ?? "http://localhost:8080";
}
export function getKeycloakServerUrl(): string {
// In CI, the Keycloak server is running in the same server as tested console, while in dev, it is running on a different port
return process.env.CI ? getTestServerUrl() : "http://localhost:8180";
}
export function getAccountUrl() {
return getTestServerUrl() + getRootPath();
}
export function getAdminUrl() {
return getKeycloakServerUrl() + "/admin/master/console/";
}