mirror of
https://github.com/tiennm99/miti99bot.git
synced 2026-05-03 14:21:41 +00:00
bd5626534b
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.
24 lines
859 B
JavaScript
24 lines
859 B
JavaScript
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>");
|
|
});
|
|
});
|