forked from phenom/healer-man
Release Healer Man 0.1.40
This commit is contained in:
1 parent
ed0d2fea3d
commit
197a64117c
215 files changed
+5131
-181
No files matched your search
@@ -0,0 +1,42 @@
|
||||
import { createElement } from "react";
|
||||
import { renderToStaticMarkup } from "react-dom/server";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { requireDungeonDefinition } from "../game/dungeonRegistry";
|
||||
import { DungeonMapGraphic } from "./DungeonMapGraphic";
|
||||
|
||||
function render(id: string, options: { compact?: boolean; showPatrols?: boolean; floorLevel?: number } = {}) {
|
||||
const dungeon = requireDungeonDefinition(id);
|
||||
return renderToStaticMarkup(createElement(DungeonMapGraphic, { dungeonId: id, position: dungeon.entrance.footPosition, yaw: 0, ...options }));
|
||||
}
|
||||
|
||||
describe("dungeon map artwork", () => {
|
||||
it("renders authentic Wailing Caverns artwork and player/entrance/numbered encounters", () => {
|
||||
const html = render("wailing-caverns");
|
||||
expect(html).toContain("wailing-caverns/maps/floor-1.png");
|
||||
expect(html).toContain('viewBox="0 0 1002 668"');
|
||||
expect(html).toContain("map-player");
|
||||
expect(html).toContain("Dungeon entrance");
|
||||
expect(html).toContain("Lady Anacondra");
|
||||
expect(html).toContain("map-marker-label");
|
||||
expect(html).not.toContain("map-contour");
|
||||
expect(html).not.toContain("map-patrol");
|
||||
});
|
||||
it("keeps the compact map clear of labels and patrols", () => {
|
||||
const html = render("wailing-caverns", { compact: true, showPatrols: true });
|
||||
expect(html).toContain("original game map");
|
||||
expect(html).not.toContain("map-marker-label");
|
||||
expect(html).not.toContain("map-patrol");
|
||||
});
|
||||
it("shows explicitly selected floor artwork", () => {
|
||||
expect(render("deadmines", { floorLevel: 2 })).toContain("deadmines/maps/floor-2.png");
|
||||
});
|
||||
it("preserves the survey fallback for RuneWaker dungeons", () => {
|
||||
const html = render("forsaken-abbey");
|
||||
expect(html).toContain('viewBox="0 0 430 300"');
|
||||
expect(html).not.toContain("<image");
|
||||
expect(html).toContain('data-artwork="unavailable"');
|
||||
});
|
||||
it("only draws patrol overlays on request", () => {
|
||||
expect(render("wailing-caverns", { showPatrols: true })).toContain("map-patrol");
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user