mirror of
https://github.com/tiennm99/miti99bot.git
synced 2026-04-28 10:20:35 +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.
23 lines
813 B
JavaScript
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 "<3"</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 ❌");
|
|
});
|
|
});
|