All checks were successful
Build & Deploy to Staging / Build & Deploy to Staging (push) Successful in 18m37s
- Delete src/routes/signup.ts (dead code, 410 handler in index.ts remains) - Remove isEmailVerified() and getVerifiedApiKey() from verification.ts (only used by signup) - Remove stale-key cleanup from cleanupStaleData() that queried legacy verifications table - Update usage middleware message: 'Free tier limit' → 'Account limit' - TDD: 8 new tests, removed signup.test.ts (dead), net 556 tests passing
91 lines
No EOL
3.4 KiB
TypeScript
91 lines
No EOL
3.4 KiB
TypeScript
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();
|
|
});
|
|
});
|
|
}); |