29 lines
722 B
TypeScript
29 lines
722 B
TypeScript
import { describe, expect, test } from "vitest";
|
|
|
|
import { readAuthConfig } from "../src/shared/auth-config";
|
|
|
|
describe("auth-config", () => {
|
|
test("returns the configured Logto settings", () => {
|
|
expect(readAuthConfig()).toEqual({
|
|
apiResource: "https://talent-search.intelligrow.cn",
|
|
appId: "i4jkllbvih0554r4n0fd3",
|
|
enableDevAuthPanel: false,
|
|
logtoEndpoint: "https://login-api.intelligrow.cn",
|
|
scopes: [
|
|
"openid",
|
|
"profile",
|
|
"offline_access",
|
|
"talent-search:read"
|
|
]
|
|
});
|
|
});
|
|
|
|
test("rejects empty endpoint values", () => {
|
|
expect(() =>
|
|
readAuthConfig({
|
|
logtoEndpoint: ""
|
|
})
|
|
).toThrow(/logtoEndpoint/i);
|
|
});
|
|
});
|