Fix reload.test.ts

Huge thanks to daykev
This commit is contained in:
RedstonewolfX 2024-09-18 11:20:25 -04:00
parent 18263c8a0d
commit 0ebd1d7080
1 changed files with 14 additions and 3 deletions

View File

@ -1,9 +1,13 @@
import { Species } from "#app/enums/species";
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 { MockClock } from "#test/utils/mocks/mockClock";
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
import { Moves } from "#app/enums/moves";
import { Biome } from "#app/enums/biome";
describe("Reload", () => {
let phaserGame: Phaser.Game;
@ -50,6 +54,13 @@ describe("Reload", () => {
game.move.select(Moves.KOWTOW_CLEAVE);
await game.phaseInterceptor.to("DamagePhase");
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();
expect(game.phaseInterceptor.log).toContain("NewBiomeEncounterPhase");