import { describe, it, expect } from "vitest"; import request from "supertest"; import { app } from "../index.js"; describe("Dead Token Verification System Removal", () => { describe("Removed Functions", () => { it("should not export verificationsCache from verification service", async () => { try { const verification = await import("../services/verification.js"); expect(verification).not.toHaveProperty("verificationsCache"); } catch (error) { // This is fine - the export doesn't exist expect(true).toBe(true); } }); it("should not export loadVerifications from verification service", async () => { try { const verification = await import("../services/verification.js"); expect(verification).not.toHaveProperty("loadVerifications"); } catch (error) { // This is fine - the export doesn't exist expect(true).toBe(true); } }); it("should not export verifyToken from verification service", async () => { try { const verification = await import("../services/verification.js"); expect(verification).not.toHaveProperty("verifyToken"); } catch (error) { // This is fine - the export doesn't exist expect(true).toBe(true); } }); it("should not export verifyTokenSync from verification service", async () => { try { const verification = await import("../services/verification.js"); expect(verification).not.toHaveProperty("verifyTokenSync"); } catch (error) { // This is fine - the export doesn't exist expect(true).toBe(true); } }); it("should not export createVerification from verification service", async () => { try { const verification = await import("../services/verification.js"); expect(verification).not.toHaveProperty("createVerification"); } catch (error) { // This is fine - the export doesn't exist expect(true).toBe(true); } }); }); describe("Removed Routes", () => { it("should return 404 for GET /verify route", async () => { const response = await request(app).get("/verify").query({ token: "some-token" }); expect(response.status).toBe(404); }); it("should return 404 for GET /verify route without token", async () => { const response = await request(app).get("/verify"); expect(response.status).toBe(404); }); }); describe("Active System Still Works", () => { it("should export createPendingVerification", async () => { const verification = await import("../services/verification.js"); expect(verification).toHaveProperty("createPendingVerification"); expect(typeof verification.createPendingVerification).toBe("function"); }); it("should export verifyCode", async () => { const verification = await import("../services/verification.js"); expect(verification).toHaveProperty("verifyCode"); expect(typeof verification.verifyCode).toBe("function"); }); // isEmailVerified and getVerifiedApiKey removed — only used by dead signup router it("should export PendingVerification interface", async () => { // TypeScript interface test - if compilation passes, the interface exists const verification = await import("../services/verification.js"); expect(verification).toBeDefined(); }); }); });