feat(platform): harden access scoping and delivery baseline
This commit is contained in:
@@ -70,6 +70,12 @@ describe("dashboard use-cases", () => {
|
||||
},
|
||||
]),
|
||||
},
|
||||
vacation: {
|
||||
count: vi.fn().mockResolvedValue(2),
|
||||
},
|
||||
estimate: {
|
||||
count: vi.fn().mockResolvedValue(5),
|
||||
},
|
||||
};
|
||||
|
||||
const result = await getDashboardOverview(db as never);
|
||||
@@ -83,6 +89,8 @@ describe("dashboard use-cases", () => {
|
||||
{ status: "ACTIVE", count: 1 },
|
||||
{ status: "DRAFT", count: 1 },
|
||||
]);
|
||||
expect(result.approvedVacations).toBe(2);
|
||||
expect(result.totalEstimates).toBe(5);
|
||||
expect(result.chapterUtilization).toEqual([
|
||||
{ chapter: "CGI", resourceCount: 2, avgChargeabilityTarget: 70 },
|
||||
{ chapter: "Unassigned", resourceCount: 1, avgChargeabilityTarget: 0 },
|
||||
@@ -134,6 +142,12 @@ describe("dashboard use-cases", () => {
|
||||
auditLog: {
|
||||
findMany: vi.fn().mockResolvedValue([]),
|
||||
},
|
||||
vacation: {
|
||||
count: vi.fn().mockResolvedValue(0),
|
||||
},
|
||||
estimate: {
|
||||
count: vi.fn().mockResolvedValue(0),
|
||||
},
|
||||
};
|
||||
|
||||
const result = await getDashboardOverview(db as never);
|
||||
@@ -242,12 +256,20 @@ describe("dashboard use-cases", () => {
|
||||
auditLog: {
|
||||
findMany: vi.fn().mockResolvedValue([]),
|
||||
},
|
||||
vacation: {
|
||||
count: vi.fn().mockResolvedValue(1),
|
||||
},
|
||||
estimate: {
|
||||
count: vi.fn().mockResolvedValue(2),
|
||||
},
|
||||
};
|
||||
|
||||
const result = await getDashboardOverview(db as never);
|
||||
|
||||
expect(result.totalAllocations).toBe(3);
|
||||
expect(result.activeAllocations).toBe(2);
|
||||
expect(result.approvedVacations).toBe(1);
|
||||
expect(result.totalEstimates).toBe(2);
|
||||
expect(result.budgetSummary).toEqual({
|
||||
totalBudgetCents: 100_000,
|
||||
totalCostCents: 4_000,
|
||||
@@ -954,6 +976,12 @@ describe("dashboard use-cases", () => {
|
||||
auditLog: {
|
||||
findMany: vi.fn().mockResolvedValue([]),
|
||||
},
|
||||
vacation: {
|
||||
count: vi.fn().mockResolvedValue(1),
|
||||
},
|
||||
estimate: {
|
||||
count: vi.fn().mockResolvedValue(4),
|
||||
},
|
||||
};
|
||||
|
||||
const result = await getDashboardOverview(db as never);
|
||||
@@ -963,6 +991,8 @@ describe("dashboard use-cases", () => {
|
||||
totalCostCents: 1_000,
|
||||
avgUtilizationPercent: 10,
|
||||
});
|
||||
expect(result.approvedVacations).toBe(1);
|
||||
expect(result.totalEstimates).toBe(4);
|
||||
});
|
||||
|
||||
it("excludes regional public holidays from project health budget usage", async () => {
|
||||
|
||||
Reference in New Issue
Block a user