fix: Refactor function calls in JobExtractionWizard to remove unnecessary void usage. Enhance test setup by adding mock implementations for update checking and installation processes, improving test coverage for application updates.

This commit is contained in:
erik
2026-07-11 00:30:49 -05:00
parent b770761832
commit 2a9eb71976
2 changed files with 8 additions and 2 deletions
@@ -529,8 +529,8 @@ export function JobExtractionWizard({
error={error}
statusText={statusText}
selectRoot={selectRoot}
discoverSchema={() => void discoverSchema()}
rediscoverWithOtherSample={() => void rediscoverWithOtherSample()}
discoverSchema={() => discoverSchema()}
rediscoverWithOtherSample={() => rediscoverWithOtherSample()}
discoverySampleLabels={discoverySampleLabels}
canRediscoverWithOtherSample={
form.mode === "general"
@@ -13,5 +13,11 @@ beforeEach(() => {
{ radicado: "R1", filename: "factura.pdf", docType: "Factura", localPath: "C:\\docs\\R1\\factura.pdf", size: 10 },
]),
readFile: vi.fn().mockResolvedValue({ filename: "factura.pdf", size: 10, data: new ArrayBuffer(8) }),
checkForUpdates: vi.fn().mockResolvedValue({
updateAvailable: false,
currentVersion: "1.0.0",
}),
installUpdate: vi.fn().mockResolvedValue({ ok: true }),
onUpdateProgress: vi.fn().mockReturnValue(() => undefined),
};
});