5191a5cce1
- MongoDB/Mongoose bağlantıları, kayıt kapalı, admin + username plugin, rate limit - DAL: getCurrentUser, requireSession, requireRole, getActionUser - Kullanıcı adı normalizasyonu: İ/I/ı → i (tr-TR 'ADMIN' → 'admın' hatası) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
21 lines
953 B
TypeScript
21 lines
953 B
TypeScript
import { describe, expect, it } from "vitest";
|
||
import { isPlaceholderEmail, placeholderEmail, storedEmail, visibleEmail } from "./account-email";
|
||
|
||
describe("yer tutucu e-posta", () => {
|
||
it("kullanıcı adından .invalid adres üretir ve tanır", () => {
|
||
const e = placeholderEmail("emre");
|
||
expect(e).toBe("emre@kullanici.butcem.invalid");
|
||
expect(isPlaceholderEmail(e)).toBe(true);
|
||
expect(isPlaceholderEmail("EMRE@KULLANICI.BUTCEM.INVALID")).toBe(true);
|
||
expect(isPlaceholderEmail("emre@ornek.com")).toBe(false);
|
||
expect(isPlaceholderEmail(undefined)).toBe(false);
|
||
});
|
||
|
||
it("kaydedilen ve gösterilen e-posta", () => {
|
||
expect(storedEmail("emre", undefined)).toBe("emre@kullanici.butcem.invalid");
|
||
expect(storedEmail("ayse", "ayse@ornek.com")).toBe("ayse@ornek.com");
|
||
expect(visibleEmail("emre@kullanici.butcem.invalid")).toBeUndefined();
|
||
expect(visibleEmail("ayse@ornek.com")).toBe("ayse@ornek.com");
|
||
});
|
||
});
|