aboutsummaryrefslogtreecommitdiffstats
path: root/packages/trpc/routers/invites.test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/trpc/routers/invites.test.ts')
-rw-r--r--packages/trpc/routers/invites.test.ts26
1 files changed, 26 insertions, 0 deletions
diff --git a/packages/trpc/routers/invites.test.ts b/packages/trpc/routers/invites.test.ts
index bb1209c4..f4f048df 100644
--- a/packages/trpc/routers/invites.test.ts
+++ b/packages/trpc/routers/invites.test.ts
@@ -6,6 +6,32 @@ import { invites, users } from "@karakeep/db/schema";
import type { CustomTestContext } from "../testUtils";
import { defaultBeforeEach, getApiCaller } from "../testUtils";
+// Mock server config with email settings
+vi.mock("@karakeep/shared/config", async (original) => {
+ const mod = (await original()) as typeof import("@karakeep/shared/config");
+ return {
+ ...mod,
+ default: {
+ ...mod.default,
+ email: {
+ smtp: {
+ host: "test-smtp.example.com",
+ port: 587,
+ secure: false,
+ user: "test@example.com",
+ password: "test-password",
+ from: "test@example.com",
+ },
+ },
+ },
+ };
+});
+
+// Mock email functions
+vi.mock("../email", () => ({
+ sendInviteEmail: vi.fn().mockResolvedValue(undefined),
+}));
+
beforeEach<CustomTestContext>(defaultBeforeEach(false));
describe("Invites Router", () => {