forked from phenom/healer-man
Release Healer Man 0.1.43
This commit is contained in:
1 parent
c7e8163790
commit
ccc01396cd
86 files changed
+2951
-198
No files matched your search
@@ -0,0 +1,27 @@
|
||||
import { afterEach, describe, expect, it, vi } from "vitest";
|
||||
import { prepareBossTesting } from "./bossTestingRuntime";
|
||||
import { BOSS_TESTING_CATALOG } from "../game/bossTesting";
|
||||
import * as content from "../content/contentManager";
|
||||
|
||||
afterEach(() => vi.restoreAllMocks());
|
||||
|
||||
describe("boss asset preparation", () => {
|
||||
const boss = BOSS_TESTING_CATALOG[0];
|
||||
it("automatically downloads and verifies only the selected boss's dungeon pack", async () => {
|
||||
const usable = vi.spyOn(content, "dungeonContentIsUsable").mockReturnValueOnce(false).mockReturnValueOnce(false).mockReturnValue(true);
|
||||
vi.spyOn(content, "initializeContentSystem").mockResolvedValue();
|
||||
const install = vi.spyOn(content, "installContentPack").mockResolvedValue();
|
||||
await prepareBossTesting(boss);
|
||||
expect(install).toHaveBeenCalledExactlyOnceWith(`dungeon:${boss.dungeonId}`);
|
||||
expect(usable).toHaveBeenCalledWith(boss.dungeonId);
|
||||
});
|
||||
it("reuses installed content and stops entry after failed verification", async () => {
|
||||
const usable = vi.spyOn(content, "dungeonContentIsUsable").mockReturnValue(true);
|
||||
vi.spyOn(content, "initializeContentSystem").mockResolvedValue();
|
||||
const install = vi.spyOn(content, "installContentPack").mockResolvedValue();
|
||||
await prepareBossTesting(boss);
|
||||
expect(install).not.toHaveBeenCalled();
|
||||
usable.mockReturnValue(false);
|
||||
await expect(prepareBossTesting(boss)).rejects.toThrow(/verified/);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user