mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-06-21 09:02:47 +02:00
https://github.com/pagefaultgames/pokerogue/pull/5927/ * Removed unnecessary test timeout parameters from test files We set it in vitest config anyways * Removed unneeded `mockRestore` calls We call `restoreAllMocks` after each test runs anyhow * Removed accidentall forgotten-about timeout * Revdrt magic bounce test file for now * Fixed ting * Fixed bug * Fixed import * Update test/data/status_effect.test.ts Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> * Update battle.test.ts Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> * Ran bim --------- Co-authored-by: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com> Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
54 lines
1.6 KiB
TypeScript
54 lines
1.6 KiB
TypeScript
import { AbilityId } from "#enums/ability-id";
|
|
import { MoveId } from "#enums/move-id";
|
|
import { ModifierTier } from "#enums/modifier-tier";
|
|
import { SelectModifierPhase } from "#app/phases/select-modifier-phase";
|
|
import { UiMode } from "#enums/ui-mode";
|
|
import GameManager from "#test/testUtils/gameManager";
|
|
import Phase from "phaser";
|
|
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
|
|
|
describe("Items - Lock Capsule", () => {
|
|
let phaserGame: Phaser.Game;
|
|
let game: GameManager;
|
|
|
|
beforeAll(() => {
|
|
phaserGame = new Phase.Game({
|
|
type: Phaser.HEADLESS,
|
|
});
|
|
});
|
|
|
|
afterEach(() => {
|
|
game.phaseInterceptor.restoreOg();
|
|
});
|
|
|
|
beforeEach(() => {
|
|
game = new GameManager(phaserGame);
|
|
|
|
game.override
|
|
.battleStyle("single")
|
|
.startingLevel(200)
|
|
.moveset([MoveId.SURF])
|
|
.enemyAbility(AbilityId.BALL_FETCH)
|
|
.startingModifier([{ name: "LOCK_CAPSULE" }]);
|
|
});
|
|
|
|
it("doesn't set the cost of common tier items to 0", async () => {
|
|
await game.classicMode.startBattle();
|
|
game.scene.phaseManager.overridePhase(
|
|
new SelectModifierPhase(0, undefined, {
|
|
guaranteedModifierTiers: [ModifierTier.COMMON, ModifierTier.COMMON, ModifierTier.COMMON],
|
|
fillRemaining: false,
|
|
}),
|
|
);
|
|
|
|
game.onNextPrompt("SelectModifierPhase", UiMode.MODIFIER_SELECT, () => {
|
|
const selectModifierPhase = game.scene.phaseManager.getCurrentPhase() as SelectModifierPhase;
|
|
const rerollCost = selectModifierPhase.getRerollCost(true);
|
|
expect(rerollCost).toBe(150);
|
|
});
|
|
|
|
game.doSelectModifier();
|
|
await game.phaseInterceptor.to("SelectModifierPhase");
|
|
});
|
|
});
|