test(api): cover isolated dashboard skill gap detail
This commit is contained in:
@@ -127,6 +127,35 @@ describe("dashboard procedure support", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("builds the isolated skill gap detail section without overview reads", async () => {
|
||||
vi.mocked(getDashboardSkillGapSummary).mockResolvedValue({
|
||||
roleGaps: [
|
||||
{ role: "Pipeline TD", needed: 4, filled: 1, gap: 3, fillRate: 25 },
|
||||
],
|
||||
totalOpenPositions: 3,
|
||||
skillSupplyTop10: [{ skill: "houdini", resourceCount: 5 }],
|
||||
resourcesByRole: [{ role: "Pipeline TD", count: 2 }],
|
||||
});
|
||||
|
||||
const result = await getDashboardDetail(createContext(), { section: "skill_gaps" });
|
||||
|
||||
expect(result).toEqual({
|
||||
skillGaps: {
|
||||
totalOpenPositions: 3,
|
||||
roleGaps: [
|
||||
{ role: "Pipeline TD", gap: 3, needed: 4, filled: 1, fillRate: 25 },
|
||||
],
|
||||
topSkillsInSupply: [{ skill: "houdini", resourceCount: 5 }],
|
||||
resourcesByRole: [{ role: "Pipeline TD", count: 2 }],
|
||||
},
|
||||
});
|
||||
expect(getDashboardSkillGapSummary).toHaveBeenCalledTimes(1);
|
||||
expect(getDashboardOverview).not.toHaveBeenCalled();
|
||||
expect(getDashboardPeakTimes).not.toHaveBeenCalled();
|
||||
expect(getDashboardDemand).not.toHaveBeenCalled();
|
||||
expect(getDashboardProjectHealth).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("builds the assistant-facing dashboard detail payload", async () => {
|
||||
vi.useFakeTimers();
|
||||
vi.setSystemTime(new Date("2026-03-15T00:00:00.000Z"));
|
||||
|
||||
Reference in New Issue
Block a user