20 lines
893 B
TypeScript
20 lines
893 B
TypeScript
// @vitest-environment node
|
|
import { readFileSync } from "node:fs";
|
|
import path from "node:path";
|
|
import { fileURLToPath } from "node:url";
|
|
import { describe, expect, it } from "vitest";
|
|
|
|
const source = readFileSync(path.join(path.dirname(fileURLToPath(import.meta.url)), "EntityHelper.ts"), "utf8");
|
|
|
|
describe("EntityHelper admin routes", () => {
|
|
it("does not emit tenant-only grouped entity routes on the admin host", () => {
|
|
expect(source).toContain("appPath({ tenantSlug: params.tenant, path: `g/${entityInGroup.slug}/${entity.slug}`");
|
|
expect(source).not.toContain("adminPath(`g/${entityInGroup.slug}/${entity.slug}`");
|
|
expect(source).toContain("adminPath(`entities/${entity.slug}/no-code/${entity.slug}`");
|
|
});
|
|
|
|
it("does not emit nonexistent portal entity row routes", () => {
|
|
expect(source).not.toContain("portals/${params.portal}/${entity.slug}/rows");
|
|
});
|
|
});
|