Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| fe32e003f4 | |||
| a681bdd7fa |
@@ -1,11 +0,0 @@
|
||||
# Interview question add recovery
|
||||
|
||||
Baseline A3 `a44a2f05`, isolated branch `codex/interview-ai-recovery`, worktree `E:/Storage/Projects/Active/temp docs/jobjakt-local-build/next-security-patch`. Source `be82e07`. Uses the qualified isolated Next16.4.6 locked installation, not A3's older on-disk modules.
|
||||
|
||||
Adding a question previously cleared its draft before the write succeeded. On failure the generic mutation error also hid the form and existing answer drafts. Both EN/NB synthetic regressions failed on original runtime source because the form disappeared. The draft now clears only after successful explicit add; mutation errors retain the loaded form and existing answer rows. Initial read failures still hide unqualified content. The existing Add button retries; no automatic write or retry was introduced.
|
||||
|
||||
PASSED: 52 affected cases/two suites (48 InterviewPrep and four connected dashboard/reminder/table route cases), non-incremental TypeScript, scoped two-file ESLint and source diff check. The two red cases are included in52;46 skipped cases in the focused red selection are not skipped final-suite tests. New cases prove whitespace-preserved draft, original trimmed title/category/target, unchanged local STAR answer, no reload after failed write, exactly two user-requested POSTs and no PATCH/delete. All API operations are synthetic; no real interview/model/provider/data mutation.
|
||||
|
||||
No schema, backend, translation catalogue, generated-content language, CV renderer, profile ownership or revision contract changed. Other mutation errors now keep existing loaded content available through the same Shell option; busy disabling and explicit confirmation remain. Successful adds retain the established preparation reload. Session/job lifetime and stale AI completion are separate proof-required work. Backend/full-suite/browser/native/device/AT/semantic AI qualification NOT RUN for this increment; the preceding framework run and browser matrices remain separately source-bound and are not added to52.
|
||||
|
||||
Native/canonical receipts: [evidence](evidence/interview-add-recovery/SOURCE_RECEIPTS.json). Existing PDF metrics/visuals not reopened. No orchestrator, main merge, production or live services. Next eligible tasks include AI suggestion/acceptance failures, stale completion proof and independent performance evidence; final A3/security/release acceptance remains open.
|
||||
@@ -1,48 +0,0 @@
|
||||
{
|
||||
"baseline": "a44a2f050fc4378262c3437e0c938a9a7beed70b",
|
||||
"sourceCommit": "be82e07",
|
||||
"sourceSha256Lf": {
|
||||
"job-tracker-ui/src/components/InterviewPrep.tsx": "008a19224278f41faca9ebef9d1ddae5c9daa95cc907c33b4a2a3342c7eba029",
|
||||
"job-tracker-ui/src/interview-prep.test.tsx": "c9bb4bee7a8d3f8b11e655c9d36b6123f1c86543127daeb32686b8db8872e786",
|
||||
"job-tracker-ui/package.json": "6b7fdd64d95ca52023969fc073b44bc9a5bc2bee2870ed42eb6714067e4dce73",
|
||||
"job-tracker-ui/package-lock.json": "3e7d849d75a7bffdbdac30990d003ebe079f649679e3add210d6f0bb323a17b9"
|
||||
},
|
||||
"nativeReceipts": [
|
||||
{
|
||||
"path": "interview-add-red.json",
|
||||
"lfSha256": "cf7753701299620619a5ed144adae64662bdc8ef5a01210cf02811a9b60cc04e",
|
||||
"rawSha256": "cf7753701299620619a5ed144adae64662bdc8ef5a01210cf02811a9b60cc04e",
|
||||
"gzipSha256": "cabd34255c3576cad78c80236cd4695364b0ee8fc78b1c5a1370755a7f6f35ea"
|
||||
},
|
||||
{
|
||||
"path": "interview-add-red.txt",
|
||||
"lfSha256": "b1d0fcce129e7225d6b23a64756fe80530744e6e41ec68e2d5fba3ee885b752a",
|
||||
"rawSha256": "b1d0fcce129e7225d6b23a64756fe80530744e6e41ec68e2d5fba3ee885b752a",
|
||||
"gzipSha256": "b678fa4e3a2eada984e3365ca9cabc9a2389aaddd0bdd29b79b07732c3b031e8"
|
||||
},
|
||||
{
|
||||
"path": "interview-add-green.json",
|
||||
"lfSha256": "f1ce2490c0c86f9fecb1bfef8dbf08600e3d68d840d214eed830db06aa3e0b77",
|
||||
"rawSha256": "f1ce2490c0c86f9fecb1bfef8dbf08600e3d68d840d214eed830db06aa3e0b77",
|
||||
"gzipSha256": "a760d3f8ae2a8fa1b5113709dd1b9aeee5c529753ab38c0369d91eba707bb254"
|
||||
},
|
||||
{
|
||||
"path": "interview-add-green.txt",
|
||||
"lfSha256": "b915014c090f928900fbf524d229d9435179483bac7bfa25a2370a3f5b187a66",
|
||||
"rawSha256": "b915014c090f928900fbf524d229d9435179483bac7bfa25a2370a3f5b187a66",
|
||||
"gzipSha256": "f035c746be860b1dc5dd39b52a77640df26585d39a7e65d9a2b6e13f4a6b0a77"
|
||||
},
|
||||
{
|
||||
"path": "interview-add-typecheck.txt",
|
||||
"lfSha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"rawSha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"gzipSha256": "46b50c321b39e89a491b6727a01628c34245605a30beb3e7414c5e01cff90e6e"
|
||||
},
|
||||
{
|
||||
"path": "interview-add-lint.txt",
|
||||
"lfSha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"rawSha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"gzipSha256": "46b50c321b39e89a491b6727a01628c34245605a30beb3e7414c5e01cff90e6e"
|
||||
}
|
||||
]
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -83,10 +83,8 @@ export function ApplicationInterviewPrep({ jobId }: { jobId: number }) {
|
||||
e.preventDefault();
|
||||
const value = title.trim();
|
||||
if (!value) return;
|
||||
return mutate(async () => {
|
||||
await interviewPrepApi.add(jobId, { category, title: value });
|
||||
setTitle("");
|
||||
});
|
||||
setTitle("");
|
||||
return mutate(() => interviewPrepApi.add(jobId, { category, title: value }));
|
||||
};
|
||||
|
||||
const startDebrief = () => mutate(() => interviewPrepApi.add(jobId, {
|
||||
@@ -104,7 +102,7 @@ export function ApplicationInterviewPrep({ jobId }: { jobId: number }) {
|
||||
subtitle={t("interviewPrepSubtitle")}
|
||||
loading={loading}
|
||||
error={error ? getApiErrorMessage(error.cause, t(error.fallback)) : null}
|
||||
keepContentOnError={error?.fallback === "interviewPrepAnswerSaveFailed" || error?.fallback === "interviewPrepUpdateFailed"}
|
||||
keepContentOnError={error?.fallback === "interviewPrepAnswerSaveFailed"}
|
||||
>
|
||||
<Stack spacing={2}>
|
||||
{board && !board.isInterviewStage && (
|
||||
|
||||
@@ -205,31 +205,6 @@ test("delete tooltip describes its wrapper while the disabled button keeps its i
|
||||
expect(mockedApi.delete).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
test.each(['en', 'nb'] as const)('failed manual preparation add retains %s question and answers for explicit retry', async language => {
|
||||
localStorage.setItem('uiLanguage', language);
|
||||
const copy = translations[language];
|
||||
mockedApi.get.mockReset(); routeGet();
|
||||
mockedApi.post.mockReset().mockRejectedValueOnce(new Error('synthetic add failure')).mockResolvedValueOnce({ data: board.groups[0].items[0] } as any);
|
||||
render(<ApplicationInterviewPrep jobId={7} />);
|
||||
const answerName = copy.interviewPrepAnswerFor.replace('{title}', 'Tell me about a conflict');
|
||||
fireEvent.change(await screen.findByRole('textbox', { name: answerName }), { target: { value: 'My local STAR answer' } });
|
||||
fireEvent.change(screen.getByLabelText(copy.interviewPrepAddLabel), { target: { value: ' Ask about shift handover ' } });
|
||||
fireEvent.click(screen.getByRole('button', { name: copy.interviewPrepAdd }));
|
||||
expect(await screen.findByText(copy.interviewPrepUpdateFailed)).toBeVisible();
|
||||
expect(screen.getByLabelText(copy.interviewPrepAddLabel)).toHaveValue(' Ask about shift handover ');
|
||||
expect(screen.getByRole('textbox', { name: answerName })).toHaveValue('My local STAR answer');
|
||||
expect(mockedApi.post).toHaveBeenCalledTimes(1);
|
||||
expect(mockedApi.get.mock.calls.filter(([url]) => String(url).endsWith('/interview-prep'))).toHaveLength(1);
|
||||
fireEvent.click(screen.getByRole('button', { name: copy.interviewPrepAdd }));
|
||||
await waitFor(() => expect(mockedApi.post).toHaveBeenCalledTimes(2));
|
||||
await waitFor(() => expect(screen.queryByText(copy.interviewPrepUpdateFailed)).not.toBeInTheDocument());
|
||||
expect(screen.getByLabelText(copy.interviewPrepAddLabel)).toHaveValue('');
|
||||
expect(screen.getByRole('textbox', { name: answerName })).toHaveValue('My local STAR answer');
|
||||
expect(mockedApi.post.mock.calls).toEqual(Array(2).fill(['/jobapplications/7/interview-prep', { category: 'company-research', title: 'Ask about shift handover' }]));
|
||||
expect(mockedApi.patch).not.toHaveBeenCalled();
|
||||
expect(mockedApi.delete).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
test("adding a prep item posts the chosen category and title", async () => {
|
||||
routeGet();
|
||||
mockedApi.post.mockResolvedValue({ data: board.groups[0].items[0] } as any);
|
||||
|
||||
Reference in New Issue
Block a user