Skip to content

Job application tracker and AI-powered job search assistant. Helps job seekers manage their search journey with AI resume review, job matching, task logging, and application analytics, all while keeping your data private.

test(timeline): update specs for the stamped stage date, the prep answer select, the Interviewer tab badge, and the reordered job-details tabs

Khuram Niazc9ce5147dbfe
diff --git a/__tests__/JobDetails.spec.tsx b/__tests__/JobDetails.spec.tsx
index 6dd1c09..8cdacdf 100644
--- a/__tests__/JobDetails.spec.tsx
+++ b/__tests__/JobDetails.spec.tsx
@@ -370,18 +370,16 @@ describe("JobDetails – tabs", () => {
expect(screen.getByRole("tab", { name: "Contacts" })).toBeInTheDocument();
});
- it("renders a Timeline tab between AI Match and Cover Letter, with a stage count", () => {
+ it("renders a Timeline tab right after Description, with a stage count", () => {
render(
<JobDetails {...baseProps} job={makeJob({ stages: [stageA, stageB] })} />,
);
const tabs = screen.getAllByRole("tab").map((t) => t.textContent);
- const matchAt = tabs.findIndex((t) => t?.startsWith("AI Match"));
+ const descriptionAt = tabs.findIndex((t) => t?.startsWith("Description"));
const timelineAt = tabs.findIndex((t) => t?.startsWith("Timeline"));
- const letterAt = tabs.findIndex((t) => t?.startsWith("Cover Letter"));
- expect(timelineAt).toBe(matchAt + 1);
- expect(letterAt).toBe(timelineAt + 1);
+ expect(timelineAt).toBe(descriptionAt + 1);
expect(screen.getByRole("tab", { name: /Timeline/ })).toHaveTextContent("2");
});
diff --git a/__tests__/StageDetailPanel.spec.tsx b/__tests__/StageDetailPanel.spec.tsx
index a1ba9f8..1b40160 100644
--- a/__tests__/StageDetailPanel.spec.tsx
+++ b/__tests__/StageDetailPanel.spec.tsx
@@ -102,7 +102,7 @@ describe("StageDetailPanel", () => {
<StageDetailPanel stage={interviewStage} isCurrent onEdit={noop} onLinkInterviewers={noop} onAddPrepQuestions={noop} onChanged={noop} />,
);
- await userEvent.click(screen.getByRole("tab", { name: "Interviewer" }));
+ await userEvent.click(screen.getByRole("tab", { name: /^Interviewer/ }));
expect(screen.getByText("Priya Nair")).toBeInTheDocument();
expect(screen.getByText("VP Engineering")).toBeInTheDocument();
@@ -155,7 +155,7 @@ describe("StageDetailPanel", () => {
<StageDetailPanel stage={interviewStage} isCurrent onEdit={noop} onLinkInterviewers={noop} onAddPrepQuestions={noop} onChanged={noop} />,
);
- await userEvent.click(screen.getByRole("tab", { name: "Interviewer" }));
+ await userEvent.click(screen.getByRole("tab", { name: /^Interviewer/ }));
rerender(
<StageDetailPanel stage={{ ...interviewStage, id: "st9" }} isCurrent onEdit={noop} onLinkInterviewers={noop} onAddPrepQuestions={noop} onChanged={noop} />,
);
diff --git a/__tests__/job.actions.spec.ts b/__tests__/job.actions.spec.ts
index 6f6324d..b1472ed 100644
--- a/__tests__/job.actions.spec.ts
+++ b/__tests__/job.actions.spec.ts
@@ -871,7 +871,14 @@ describe("jobActions", () => {
},
prepQuestions: {
include: {
- Question: { select: { id: true, question: true, tags: true } },
+ Question: {
+ select: {
+ id: true,
+ question: true,
+ answer: true,
+ tags: true,
+ },
+ },
},
orderBy: { createdAt: "asc" },
},
diff --git a/__tests__/updateJobFromNames.spec.ts b/__tests__/updateJobFromNames.spec.ts
index fdce0d8..807fcf8 100644
--- a/__tests__/updateJobFromNames.spec.ts
+++ b/__tests__/updateJobFromNames.spec.ts
@@ -190,7 +190,7 @@ describe("updateJobFromNames", () => {
expect((prisma as any).jobStage.create.mock.calls[0][0].data).toMatchObject({
jobId: "job-1",
stageTypeId: "t-offer",
- occurredAt: null,
+ occurredAt: expect.any(Date),
});
});