mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2026-08-23 23:02:17 +10:00
feat: add application timeline history (#3237)
* feat: add application timeline history * fix: address application timeline review * fix: keep application tracker e2e stable * fix: use stable timeline e2e selector * fix: target timeline note input in e2e
This commit is contained in:
@@ -71,6 +71,8 @@ const clientMock = {
|
||||
create: vi.fn(),
|
||||
update: vi.fn(),
|
||||
addNote: vi.fn(),
|
||||
updateTimelineEntry: vi.fn(),
|
||||
deleteTimelineEntry: vi.fn(),
|
||||
delete: vi.fn(),
|
||||
bulkUpdate: vi.fn(),
|
||||
bulkDelete: vi.fn(),
|
||||
@@ -185,6 +187,51 @@ describe("registerTools", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("adds dated application notes through the router client", async () => {
|
||||
clientMock.applications.addNote.mockResolvedValueOnce({ id: "app-1", company: "Acme" });
|
||||
const { server, registered } = makeFakeServer();
|
||||
registerTools(server as never, clientMock as never, new Headers());
|
||||
|
||||
const tool = registered.find((item) => item.name === "add_application_note")!;
|
||||
await tool.handler({ id: "app-1", text: "Recruiter replied", date: "2026-07-12" });
|
||||
|
||||
expect(clientMock.applications.addNote).toHaveBeenCalledWith({
|
||||
id: "app-1",
|
||||
text: "Recruiter replied",
|
||||
date: "2026-07-12",
|
||||
});
|
||||
});
|
||||
|
||||
it("updates application timeline entries through the router client", async () => {
|
||||
clientMock.applications.updateTimelineEntry.mockResolvedValueOnce({ id: "app-1", company: "Acme" });
|
||||
const { server, registered } = makeFakeServer();
|
||||
registerTools(server as never, clientMock as never, new Headers());
|
||||
|
||||
const tool = registered.find((item) => item.name === "update_application_timeline_entry")!;
|
||||
await tool.handler({ id: "app-1", entryId: "entry-1", date: "2026-07-13", text: "Updated note" });
|
||||
|
||||
expect(clientMock.applications.updateTimelineEntry).toHaveBeenCalledWith({
|
||||
id: "app-1",
|
||||
entryId: "entry-1",
|
||||
date: "2026-07-13",
|
||||
text: "Updated note",
|
||||
});
|
||||
});
|
||||
|
||||
it("deletes application timeline entries through the router client", async () => {
|
||||
clientMock.applications.deleteTimelineEntry.mockResolvedValueOnce({ id: "app-1", company: "Acme" });
|
||||
const { server, registered } = makeFakeServer();
|
||||
registerTools(server as never, clientMock as never, new Headers());
|
||||
|
||||
const tool = registered.find((item) => item.name === "delete_application_timeline_entry")!;
|
||||
await tool.handler({ id: "app-1", entryId: "entry-1" });
|
||||
|
||||
expect(clientMock.applications.deleteTimelineEntry).toHaveBeenCalledWith({
|
||||
id: "app-1",
|
||||
entryId: "entry-1",
|
||||
});
|
||||
});
|
||||
|
||||
it("imports applications with followUpAt coerced to Date and null preserved", async () => {
|
||||
clientMock.applications.import.mockResolvedValueOnce({ imported: 2 });
|
||||
const { server, registered } = makeFakeServer();
|
||||
|
||||
Reference in New Issue
Block a user