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: support import name lookup in PDF fixtures

Amruth Pillai3855aab9bbc4
diff --git a/packages/api/src/features/resume/import-annotations.test.ts b/packages/api/src/features/resume/import-annotations.test.ts
index c1f0b7389..d75b8f58a 100644
--- a/packages/api/src/features/resume/import-annotations.test.ts
+++ b/packages/api/src/features/resume/import-annotations.test.ts
@@ -12,7 +12,14 @@ vi.mock("@reactive-resume/auth/config", () => ({
verifyOAuthToken: vi.fn(),
}));
vi.mock("@reactive-resume/db/client", () => ({
- db: { select: () => ({ from: () => ({ where: () => ({ limit: async () => [{ id: "owner", banned: false }] }) }) }) },
+ db: {
+ select: () => ({
+ from: () => ({
+ // Auth selects one owner; import naming awaits the query for existing resume names.
+ where: () => Object.assign(Promise.resolve([]), { limit: async () => [{ id: "owner", banned: false }] }),
+ }),
+ }),
+ },
}));
const { importResumeFile } = await import("./imports");
diff --git a/packages/api/src/features/resume/import-education.test.ts b/packages/api/src/features/resume/import-education.test.ts
index ae209e646..91be91a4d 100644
--- a/packages/api/src/features/resume/import-education.test.ts
+++ b/packages/api/src/features/resume/import-education.test.ts
@@ -9,7 +9,14 @@ vi.mock("@reactive-resume/auth/config", () => ({
verifyOAuthToken: vi.fn(),
}));
vi.mock("@reactive-resume/db/client", () => ({
- db: { select: () => ({ from: () => ({ where: () => ({ limit: async () => [{ id: "owner", banned: false }] }) }) }) },
+ db: {
+ select: () => ({
+ from: () => ({
+ // Auth selects one owner; import naming awaits the query for existing resume names.
+ where: () => Object.assign(Promise.resolve([]), { limit: async () => [{ id: "owner", banned: false }] }),
+ }),
+ }),
+ },
}));
const { importResumeFile } = await import("./imports");
diff --git a/packages/api/src/features/resume/import-layouts.test.ts b/packages/api/src/features/resume/import-layouts.test.ts
index a8624ccb0..8007046fb 100644
--- a/packages/api/src/features/resume/import-layouts.test.ts
+++ b/packages/api/src/features/resume/import-layouts.test.ts
@@ -10,7 +10,14 @@ vi.mock("@reactive-resume/auth/config", () => ({
verifyOAuthToken: vi.fn(),
}));
vi.mock("@reactive-resume/db/client", () => ({
- db: { select: () => ({ from: () => ({ where: () => ({ limit: async () => [{ id: "owner", banned: false }] }) }) }) },
+ db: {
+ select: () => ({
+ from: () => ({
+ // Auth selects one owner; import naming awaits the query for existing resume names.
+ where: () => Object.assign(Promise.resolve([]), { limit: async () => [{ id: "owner", banned: false }] }),
+ }),
+ }),
+ },
}));
const { importResumeFile } = await import("./imports");
diff --git a/packages/api/src/features/resume/import-ownership.test.ts b/packages/api/src/features/resume/import-ownership.test.ts
index 6708c22ef..b915c7abb 100644
--- a/packages/api/src/features/resume/import-ownership.test.ts
+++ b/packages/api/src/features/resume/import-ownership.test.ts
@@ -10,7 +10,14 @@ vi.mock("@reactive-resume/auth/config", () => ({
verifyOAuthToken: vi.fn(),
}));
vi.mock("@reactive-resume/db/client", () => ({
- db: { select: () => ({ from: () => ({ where: () => ({ limit: async () => [{ id: "owner", banned: false }] }) }) }) },
+ db: {
+ select: () => ({
+ from: () => ({
+ // Auth selects one owner; import naming awaits the query for existing resume names.
+ where: () => Object.assign(Promise.resolve([]), { limit: async () => [{ id: "owner", banned: false }] }),
+ }),
+ }),
+ },
}));
const { importResumeFile } = await import("./imports");