mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-27 02:32:21 +02:00
Fix reload.test.ts
Huge thanks to daykev
This commit is contained in:
parent
18263c8a0d
commit
0ebd1d7080
@ -1,9 +1,13 @@
|
|||||||
import { Species } from "#app/enums/species";
|
|
||||||
import { GameModes } from "#app/game-mode";
|
import { GameModes } from "#app/game-mode";
|
||||||
|
import OptionSelectUiHandler from "#app/ui/settings/option-select-ui-handler";
|
||||||
|
import { Mode } from "#app/ui/ui";
|
||||||
|
import { Biome } from "#enums/biome";
|
||||||
|
import { Button } from "#enums/buttons";
|
||||||
|
import { Moves } from "#enums/moves";
|
||||||
|
import { Species } from "#enums/species";
|
||||||
import GameManager from "#test/utils/gameManager";
|
import GameManager from "#test/utils/gameManager";
|
||||||
|
import { MockClock } from "#test/utils/mocks/mockClock";
|
||||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||||
import { Moves } from "#app/enums/moves";
|
|
||||||
import { Biome } from "#app/enums/biome";
|
|
||||||
|
|
||||||
describe("Reload", () => {
|
describe("Reload", () => {
|
||||||
let phaserGame: Phaser.Game;
|
let phaserGame: Phaser.Game;
|
||||||
@ -50,6 +54,13 @@ describe("Reload", () => {
|
|||||||
game.move.select(Moves.KOWTOW_CLEAVE);
|
game.move.select(Moves.KOWTOW_CLEAVE);
|
||||||
await game.phaseInterceptor.to("DamagePhase");
|
await game.phaseInterceptor.to("DamagePhase");
|
||||||
await game.doKillOpponents();
|
await game.doKillOpponents();
|
||||||
|
game.onNextPrompt("SelectBiomePhase", Mode.OPTION_SELECT, () => {
|
||||||
|
(game.scene.time as MockClock).overrideDelay = null;
|
||||||
|
const optionSelectUiHandler = game.scene.ui.getHandler() as OptionSelectUiHandler;
|
||||||
|
game.scene.time.delayedCall(1010, () => optionSelectUiHandler.processInput(Button.ACTION));
|
||||||
|
game.endPhase();
|
||||||
|
(game.scene.time as MockClock).overrideDelay = 1;
|
||||||
|
});
|
||||||
await game.toNextWave();
|
await game.toNextWave();
|
||||||
expect(game.phaseInterceptor.log).toContain("NewBiomeEncounterPhase");
|
expect(game.phaseInterceptor.log).toContain("NewBiomeEncounterPhase");
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user