forked from phenom/healer-man
Release Healer Man 0.1.22
This commit is contained in:
1 parent
f6f2375145
commit
7f6001723a
144 files changed
+54107
-690
No files matched your search
@@ -7,12 +7,16 @@ import { usePartyStore } from "./partyStore";
|
||||
import { useGameStore } from "./store";
|
||||
import { DEFAULT_MANASTORM_ADMIN_CONFIG } from "./manastormAdminConfig";
|
||||
import { useManastormAdminStore } from "./manastormAdminStore";
|
||||
import { dungeonEncounterSnapshot } from "./dungeonEncounterRuntime";
|
||||
import {
|
||||
dungeonEncounterSnapshot,
|
||||
importDungeonEncounterSnapshots,
|
||||
} from "./dungeonEncounterRuntime";
|
||||
import { WAILING_NARALEX_ENCOUNTER, useWailingEncounterStore } from "./wailingCavernsEncounter";
|
||||
|
||||
describe("dungeon session asset eviction", () => {
|
||||
afterEach(() => {
|
||||
vi.restoreAllMocks();
|
||||
vi.unstubAllEnvs();
|
||||
useManastormAdminStore.setState({ config: DEFAULT_MANASTORM_ADMIN_CONFIG, draft: DEFAULT_MANASTORM_ADMIN_CONFIG, dirty: false });
|
||||
useGameStore.getState().activateDungeon("wailing-caverns");
|
||||
});
|
||||
@@ -35,11 +39,26 @@ describe("dungeon session asset eviction", () => {
|
||||
expect(clear).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("restarts the active dungeon in place while preserving its party", () => {
|
||||
const active = dungeonDefinitionById("deadmines")!;
|
||||
useGameStore.getState().activateDungeon(active.id);
|
||||
it("does not activate a direct production session before its dungeon pack is usable", () => {
|
||||
vi.stubEnv("DEV", false);
|
||||
useGameStore.getState().activateDungeon("wailing-caverns");
|
||||
const clear = vi.spyOn(useGLTF, "clear").mockImplementation(() => undefined);
|
||||
|
||||
expect(activateDungeonSession("deadmines")).toBe(false);
|
||||
expect(useGameStore.getState().activeDungeonId).toBe("wailing-caverns");
|
||||
expect(clear).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("restarts the active dungeon in place while preserving its party and encounter state", () => {
|
||||
const active = dungeonDefinitionById("wailing-caverns")!;
|
||||
expect(activateDungeonSession(active.id)).toBe(true);
|
||||
usePartyStore.getState().initializeParty("retry-party", 20, 600, "healer");
|
||||
const members = usePartyStore.getState().members.map((member) => member.id);
|
||||
const current = dungeonEncounterSnapshot(WAILING_NARALEX_ENCOUNTER.id)!;
|
||||
const progressed = { ...current, phase: "ready", revision: current.revision + 1 } as const;
|
||||
expect(importDungeonEncounterSnapshots(active.id, [progressed])).toEqual([
|
||||
WAILING_NARALEX_ENCOUNTER.id,
|
||||
]);
|
||||
const revision = useGameStore.getState().sessionRevision;
|
||||
const clear = vi.spyOn(useGLTF, "clear").mockImplementation(() => undefined);
|
||||
|
||||
@@ -48,6 +67,10 @@ describe("dungeon session asset eviction", () => {
|
||||
expect(clear.mock.calls.map(([url]) => url)).toEqual(dungeonGltfUrls(active));
|
||||
expect(useGameStore.getState().sessionRevision).toBe(revision + 1);
|
||||
expect(usePartyStore.getState().members.map((member) => member.id)).toEqual(members);
|
||||
expect(dungeonEncounterSnapshot(WAILING_NARALEX_ENCOUNTER.id)).toMatchObject({
|
||||
phase: "ready",
|
||||
revision: progressed.revision,
|
||||
});
|
||||
});
|
||||
|
||||
it("applies the published dungeon group anchor at the session boundary", () => {
|
||||
@@ -59,9 +82,9 @@ describe("dungeon session asset eviction", () => {
|
||||
expect(useGameStore.getState().activeSpawn).toEqual(spawn);
|
||||
});
|
||||
|
||||
it("hydrates a safe encounter checkpoint after the dungeon reset", () => {
|
||||
it("hydrates a same-process checkpoint even when the reset revision is newer", () => {
|
||||
const current = dungeonEncounterSnapshot(WAILING_NARALEX_ENCOUNTER.id)!;
|
||||
const saved = { ...current, phase: "ready", revision: current.revision + 10 } as const;
|
||||
const saved = { ...current, phase: "ready" } as const;
|
||||
expect(activateDungeonSession("wailing-caverns", "normal", {
|
||||
encounterSnapshots: [saved],
|
||||
})).toBe(true);
|
||||
|
||||
Reference in new issue
Block a user