feat(admin): add user account management

This commit is contained in:
dmg
2026-08-01 14:16:46 -04:00
parent c5de0a1810
commit 10554eeaff
10 changed files with 690 additions and 6 deletions
+6 -1
View File
@@ -1,5 +1,5 @@
import { describe, expect, it, vi } from "vitest";
import { formatDiscordNickname, lookupJavaProfile } from "../src/index";
import { formatDiscordNickname, formatManagedDiscordNickname, lookupJavaProfile } from "../src/index";
describe("Java Edition profiles", () => {
it("returns Mojang's canonical UUID and username", async () => {
@@ -27,4 +27,9 @@ describe("Java Edition profiles", () => {
);
expect(formatDiscordNickname("Sam", "Notch")).toBe("Sam (Notch)");
});
it("falls back to the user's name when an admin removes their final account", () => {
expect(formatManagedDiscordNickname("Alexandria Catherine", null)).toBe("Alexandria Catherine");
expect(formatManagedDiscordNickname("A name that is definitely longer than Discord allows", null)).toHaveLength(32);
});
});