test(server): isolate invite rate limit route

Co-authored-by: Paperclip <noreply@paperclip.ing>
This commit is contained in:
Nicky LeachandPaperclip committed 2026-07-15 06:06:15 +00:00
1 parent b020aebf90
commit 21cd837f42
1 file changed
+9
@@ -3,6 +3,15 @@ import request from "supertest";
import { beforeEach, describe, expect, it, vi } from "vitest";
import { createInviteRateLimiter } from "../services/invite-rate-limit.js";
vi.mock("../services/index.js", () => ({
accessService: vi.fn(() => ({})),
agentService: vi.fn(() => ({})),
boardAuthService: vi.fn(() => ({})),
deduplicateAgentName: vi.fn((name: string) => name),
logActivity: vi.fn().mockResolvedValue(undefined),
notifyHireApproved: vi.fn().mockResolvedValue(undefined),
}));
function createSelectChain(rows: unknown[]) {
const query = {
then(resolve: (value: unknown[]) => unknown) {