feat(plan): listPlanUsers with role/permission filter
This commit is contained in:
@@ -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);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user