Track HiveGrid Cloud planning reference
This commit is contained in:
1 parent
b3d5ea6764
commit
e341c5938a
5784 files changed
+1104929
-3
No files matched your search
@@ -0,0 +1,26 @@
|
||||
import { readFileSync } from "node:fs";
|
||||
import { resolve } from "node:path";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
const rootPath = (...segments: string[]) => resolve(process.cwd(), ...segments);
|
||||
const readProjectFile = (path: string) => readFileSync(rootPath(path), "utf8");
|
||||
|
||||
describe("row tenant-scope guard", () => {
|
||||
it("requires explicit tenant and entity scope for row reloads", () => {
|
||||
const source = readProjectFile("apps/web/app/utils/db/entities/rows.db.server.ts");
|
||||
|
||||
expect(source).toContain("getRowById(id: string, scope: { entityId?: string; tenantId: string | null })");
|
||||
expect(source).not.toContain("getRowById(id: string, scope?:");
|
||||
expect(source).not.toContain("RowModelHelper.includeRowDetailsNested");
|
||||
});
|
||||
|
||||
it("keeps legacy row relationship helpers tenant-scoped", () => {
|
||||
const source = readProjectFile("apps/web/app/utils/db/entities/rowRelationships.db.server.ts");
|
||||
|
||||
expect(source).toContain("type RowRelationshipTenantScope");
|
||||
expect(source).toContain("parent: { deletedAt: null, tenantId: scope.tenantId }");
|
||||
expect(source).toContain("child: { deletedAt: null, tenantId: scope.tenantId }");
|
||||
expect(source).not.toContain("findUnique({");
|
||||
expect(source).not.toContain("where: { id },");
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user