mirror of
https://github.com/tiennm99/miti99bot.git
synced 2026-05-07 19:36:31 +00:00
feat(loldle): add emoji and quote champion-guessing modules
Ship two new loldle-family modules mirroring loldle.net's non-classic modes. Text-only MVP (ability/splash phases stay deferred). - loldle-emoji: 5 guesses, emoji-sequence clue. Pool derived algorithmically from classic's champions.json metadata (species/region/resource mapping table) since loldle.net's bundle has no static emoji pool. - loldle-quote: 6 guesses, lore-blurb clue. Pool seeded from Data Dragon champion title + first lore sentence; champion name redacted to ___. - scripts/fetch-ddragon-data.js: single generator for both JSONs. - src/util/normalize-name.js: shared lookup helper; loldle/lookup.js refactored to import it. 35 new tests (484 total passing). Lint clean.
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { renderBoard } from "../../../src/modules/loldle-emoji/render.js";
|
||||
|
||||
describe("renderBoard (emoji)", () => {
|
||||
it("shows an empty-state hint when no guesses yet", () => {
|
||||
const out = renderBoard("🦊 🏯 🔮", [], 5);
|
||||
expect(out).toContain("🎭 🦊 🏯 🔮");
|
||||
expect(out).toContain("No guesses yet.");
|
||||
});
|
||||
|
||||
it("lists guesses with wrong markers and guess counter", () => {
|
||||
const out = renderBoard("🦊 🏯 🔮", ["Akali", "Aatrox"], 5);
|
||||
expect(out).toContain("Guesses (2/5):");
|
||||
expect(out).toContain("• Akali ❌");
|
||||
expect(out).toContain("• Aatrox ❌");
|
||||
});
|
||||
|
||||
it("HTML-escapes champion names", () => {
|
||||
const out = renderBoard("🦊", ["<script>"], 5);
|
||||
expect(out).toContain("<script>");
|
||||
expect(out).not.toContain("<script>");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user