feat(history): add unified MCP execution history
This commit is contained in:
39 files changed
+1261
-87
No files matched your search
@@ -9,6 +9,7 @@ vi.mock("@/lib/backend/api", () => ({
|
||||
saveHistory: vi.fn(),
|
||||
deleteHistoryEntry: vi.fn(),
|
||||
clearHistory: vi.fn(),
|
||||
clearHistoryBySource: vi.fn(),
|
||||
loadHistoryConnectionOptions: vi.fn(),
|
||||
}));
|
||||
|
||||
@@ -92,6 +93,15 @@ describe("historyStore", () => {
|
||||
expect(store.nextCursor).toBeNull();
|
||||
});
|
||||
|
||||
it("clears only the requested history source", async () => {
|
||||
vi.mocked(api.clearHistoryBySource).mockResolvedValue(undefined);
|
||||
const store = useHistoryStore();
|
||||
await store.clear("mcp");
|
||||
expect(api.clearHistoryBySource).toHaveBeenCalledWith("mcp");
|
||||
expect(api.clearHistory).not.toHaveBeenCalled();
|
||||
expect(api.loadHistoryConnectionOptions).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("ignores a search started while deletion is pending", async () => {
|
||||
const stored = entry();
|
||||
vi.mocked(api.searchHistory).mockResolvedValueOnce({ entries: [stored], total: 1, next_cursor: null });
|
||||
|
||||
Reference in new issue
Block a user