Files
miti99bot/tests/modules/loldle-quote/render.test.js
T
tiennm99 bd5626534b 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.
2026-04-24 23:30:11 +07:00

23 lines
813 B
JavaScript

import { describe, expect, it } from "vitest";
import { renderBoard } from "../../../src/modules/loldle-quote/render.js";
describe("renderBoard (quote)", () => {
it("wraps quote in italic with emoji prefix", () => {
const out = renderBoard("the Demacian", [], 6);
expect(out).toContain("🎭 <i>the Demacian</i>");
expect(out).toContain("No guesses yet.");
});
it("HTML-escapes quote text before italic wrap", () => {
const out = renderBoard('She said "<3"', [], 6);
expect(out).toContain("<i>She said &quot;&lt;3&quot;</i>");
expect(out).not.toContain('She said "<3"</i>');
});
it("lists wrong guesses with counter", () => {
const out = renderBoard("the X", ["Ahri"], 6);
expect(out).toContain("Guesses (1/6):");
expect(out).toContain("• Ahri ❌");
});
});