Release Healer Man 0.1.14

This commit is contained in:
phenom committed 2026-09-05 11:40:50 -04:00
1 parent 67d7a8ebe7
commit 7b41b102fa
147 files changed
+169892 -1342

No files matched your search

+30 -5
View File
@@ -1,16 +1,24 @@
import { createElement } from "react";
import { renderToStaticMarkup } from "react-dom/server";
import { describe, expect, it } from "vitest";
import { beforeEach, describe, expect, it, vi } from "vitest";
const combatMedia = vi.hoisted(() => ({ ready: false }));
vi.mock("../game/combatMediaPack", async (importOriginal) => ({
...(await importOriginal<typeof import("../game/combatMediaPack")>()),
combatMediaPackReady: () => combatMedia.ready,
}));
import { DEFAULT_COMBAT_PRESENTATION_SETTINGS, type CombatVfxMode } from "../game/combatPresentation";
import { DEFAULT_GAMEPLAY_SETTINGS } from "../game/combatStore";
import { OptionsPanel, nextCombatVfxMode } from "./OptionsPanel";
function renderOptions(mode: CombatVfxMode): string {
function renderOptions(mode: CombatVfxMode, originalMediaEnabled = false): string {
return renderToStaticMarkup(createElement(OptionsPanel, {
settings: DEFAULT_GAMEPLAY_SETTINGS,
onChange: () => undefined,
onReset: () => undefined,
presentationSettings: { ...DEFAULT_COMBAT_PRESENTATION_SETTINGS, vfxMode: mode },
presentationSettings: { ...DEFAULT_COMBAT_PRESENTATION_SETTINGS, originalMediaEnabled, vfxMode: mode },
onPresentationChange: () => undefined,
onPresentationReset: () => undefined,
open: true,
@@ -19,6 +27,10 @@ function renderOptions(mode: CombatVfxMode): string {
}
describe("combat visual mode option", () => {
beforeEach(() => {
combatMedia.ready = false;
});
it("cycles between generated and strict original selections", () => {
expect(nextCombatVfxMode("generated")).toBe("original");
expect(nextCombatVfxMode("original")).toBe("generated");
@@ -28,15 +40,28 @@ describe("combat visual mode option", () => {
const markup = renderOptions(DEFAULT_COMBAT_PRESENTATION_SETTINGS.vfxMode);
expect(markup).toContain("Spell visual mode");
expect(markup).toContain("Use the current generated combat effects.");
expect(markup).toContain("Original spell effects &amp; sounds");
expect(markup).toContain("Not downloaded by default.");
expect(markup).toContain(">Download</button>");
expect(markup).toContain("Generated effects are used until the optional original media pack is downloaded.");
expect(markup).toContain(">Generated</button>");
});
it("states that original mode never substitutes generated effects", () => {
const markup = renderOptions("original");
combatMedia.ready = true;
const markup = renderOptions("original", true);
expect(markup).toContain("Use only packaged original source effects.");
expect(markup).toContain("Unsupported spells show no visual effect.");
expect(markup).toContain(">Original</button>");
expect(markup).toContain(">Remove</button>");
});
it("offers to enable an already downloaded pack without downloading it again", () => {
combatMedia.ready = true;
const markup = renderOptions("generated", false);
expect(markup).toContain("Stored on this device. Enable the pack");
expect(markup).toContain(">Enable</button>");
});
});