fix(FN-690): fix migration schema, dashboard type guards, and test stability

- Fix SQL parameter mismatch in db-migrate task INSERT (add baseCommitSha, modifiedFiles, sliceId columns)
- Fix dashboard routes type predicate to guard against null entries from git diff parsing
- Stabilize central-core activity cleanup test with fake timers
- Align executor test assertions with updated steering comment log messages
- Align store test comment log assertion with new action/outcome format
This commit is contained in:
gsxdsm
2026-04-01 09:19:50 -07:00
parent 30b9bc6e6e
commit 805e15eb8a
6 changed files with 88 additions and 60 deletions

View File

@@ -712,29 +712,36 @@ describe("CentralCore", () => {
});
it("should cleanup old activity entries", async () => {
const projectPath = join(tempDir, "cleanup-activity");
mkdirSync(projectPath);
projectPaths.push(projectPath);
vi.useFakeTimers();
const now = new Date("2026-01-15T12:00:00.000Z");
vi.setSystemTime(now);
const project = await central.registerProject({
name: "Cleanup Activity",
path: projectPath,
});
try {
const projectPath = join(tempDir, "cleanup-activity");
mkdirSync(projectPath);
projectPaths.push(projectPath);
// Log a recent activity
await central.logActivity({
type: "task:created",
projectId: project.id,
projectName: project.name,
timestamp: new Date().toISOString(),
details: "Recent",
});
const project = await central.registerProject({
name: "Cleanup Activity",
path: projectPath,
});
const deleted = await central.cleanupOldActivity(0); // Delete all older than 0 days
expect(deleted).toBe(0); // The recent one shouldn't be deleted
await central.logActivity({
type: "task:created",
projectId: project.id,
projectName: project.name,
timestamp: now.toISOString(),
details: "Recent",
});
const countAfter = await central.getActivityCount();
expect(countAfter).toBe(1);
const deleted = await central.cleanupOldActivity(-1);
expect(deleted).toBe(0);
const countAfter = await central.getActivityCount();
expect(countAfter).toBe(1);
} finally {
vi.useRealTimers();
}
});
});