Skip to content

A one-of-a-kind resume builder that keeps your privacy in mind. Completely secure, customizable, portable, open-source and free forever. Try it out today!

test: reject scanned PDFs without creating a resume

Amruth Pillai57a5bab22a9d
diff --git a/apps/mobile/scripts/import-file.test.mjs b/apps/mobile/scripts/import-file.test.mjs
index f6283424b..1bb808e85 100644
--- a/apps/mobile/scripts/import-file.test.mjs
+++ b/apps/mobile/scripts/import-file.test.mjs
@@ -34,6 +34,7 @@ for (const scenario of [
"local",
"partial AI",
"partial local",
+ "scanned local",
"older AI",
"older local",
"malformed AI",
@@ -102,6 +103,8 @@ for (const scenario of [
if (scenario === "changed during source") scope = "new-account";
if (scenario === "canceled during source") controller.abort();
if (scenario.startsWith("older")) return new Response("", { status: 404 });
+ if (scenario === "scanned local")
+ return Response.json({ data: null, source: { lines: [], links: [], partial: false } });
return Response.json(
scenario.startsWith("malformed")
? { data: "invalid" }
@@ -137,6 +140,12 @@ for (const scenario of [
assert.equal(saved, 0);
return;
}
+ if (scenario === "scanned local") {
+ await assert.rejects(reading, /This PDF is a scanned image\./);
+ assert.equal(saved, 0);
+ assert.equal(modelCalls, 0);
+ return;
+ }
if (scenario === "older local") {
await assert.rejects(reading, /Update your server/);
assert.equal(saved, 0);