Reorganize repo structure and standards references
This commit is contained in:
1 parent
3cb93a81be
commit
be2054274d
5885 files changed
+2588
-195
No files matched your search
+35
@@ -0,0 +1,35 @@
|
||||
// @vitest-environment node
|
||||
import { describe, expect, test } from "vitest";
|
||||
import { readFileSync } from "node:fs";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import path from "node:path";
|
||||
|
||||
const source = readFileSync(path.join(path.dirname(fileURLToPath(import.meta.url)), "users.db.server.ts"), "utf8");
|
||||
|
||||
describe("users db wrapper", () => {
|
||||
test("allows user profile updates to persist light or dark mode", () => {
|
||||
expect(source).toContain("lightOrDarkMode?: string");
|
||||
});
|
||||
|
||||
test("provides a tenant-scoped user details helper for app routes", () => {
|
||||
expect(source).toContain("export async function getTenantScopedUsersWithDetails(tenantId: string)");
|
||||
expect(source).toContain("tenants: {\n where: {\n tenantId,\n },");
|
||||
expect(source).toContain("roles: {\n where: {\n tenantId,\n },");
|
||||
});
|
||||
|
||||
test("keeps core user registration free of CRM and marketing side effects", () => {
|
||||
expect(source).not.toContain("~/modules/crm/services/CrmService");
|
||||
expect(source).not.toContain("marketingSubscriber: true");
|
||||
expect(source).not.toContain("Created user contact");
|
||||
});
|
||||
|
||||
test("returns the persisted default tenant after user registration", () => {
|
||||
expect(source).toContain("defaultTenantId: user.defaultTenantId");
|
||||
});
|
||||
|
||||
test("parallelizes admin user pagination queries", () => {
|
||||
expect(source).toContain("const [items, totalItems] = await Promise.all([");
|
||||
expect(source).toContain("db.user.findMany({");
|
||||
expect(source).toContain("db.user.count({\n where,\n }),");
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user