Files
HiveGrid-Wireframes/03 Quellen und Referenzen/hivegrid-cloud/apps/web/app/services/admin/admin-public-booking.server.test.ts
T

26 lines
720 B
TypeScript

import { describe, expect, it } from "vitest";
import { isAdminPublicBookingHost } from "./admin-public-booking.server";
describe("admin public booking boundary", () => {
it("accepts only the dedicated meeting host", () => {
expect(
isAdminPublicBookingHost(
new Request("http://meet.localhost:3000/erstgespraech")
)
).toBe(true);
expect(
isAdminPublicBookingHost(
new Request("http://admin.localhost:3000/erstgespraech")
)
).toBe(false);
expect(
isAdminPublicBookingHost(
new Request("http://attacker.invalid/erstgespraech", {
headers: { "x-forwarded-host": "meet.localhost:3000" },
})
)
).toBe(false);
});
});