feat(interviews): add durable debrief loop

This commit is contained in:
cesnimda
2026-08-31 17:20:58 +02:00
parent c2181afaea
commit 7d5a78ad5d
8 changed files with 60 additions and 3 deletions
@@ -102,6 +102,24 @@ test("adding a prep item posts the chosen category and title", async () => {
));
});
test("starts a structured interview debrief without inventing answers", async () => {
routeGet();
mockedApi.post.mockResolvedValue({ data: board.groups[0].items[0] } as any);
render(<ApplicationInterviewPrep jobId={7} />);
fireEvent.click(await screen.findByRole("button", { name: "Start debrief" }));
await waitFor(() => expect(mockedApi.post).toHaveBeenCalledWith(
"/jobapplications/7/interview-prep",
{
category: "debrief",
title: "Interview debrief",
content: expect.stringContaining("Questions asked:"),
},
));
expect(mockedApi.post.mock.calls[0][1].content).not.toMatch(/Acme|achievement|metric/i);
});
test("marking an item ready patches it", async () => {
routeGet();
mockedApi.patch.mockResolvedValue({ data: board.groups[1].items[0] } as any);