feat(plan): listPlanUsers with role/permission filter

This commit is contained in:
BOHA
2026-06-05 12:13:16 +02:00
parent f79967d433
commit 42f9561337
2 changed files with 68 additions and 1 deletions

View File

@@ -1,6 +1,10 @@
import { describe, it, expect, beforeAll, afterAll, beforeEach } from "vitest";
import prisma from "../config/database";
import { resolveCell, resolveGrid } from "../services/plan.service";
import {
resolveCell,
resolveGrid,
listPlanUsers,
} from "../services/plan.service";
// ---------------------------------------------------------------------------
// Test fixtures
@@ -170,3 +174,16 @@ describe("plan.service.resolveGrid", () => {
expect(cells[adminUserId]["2099-06-03"]?.note).toBe(`${N}A`);
});
});
// ---------------------------------------------------------------------------
// listPlanUsers
// ---------------------------------------------------------------------------
describe("plan.service.listPlanUsers", () => {
it("returns at least the admin user", async () => {
const users = await listPlanUsers();
const found = users.find((u) => u.id === adminUserId);
expect(found).toBeDefined();
expect(found?.has_attendance_record).toBe(true);
});
});