Fix Focus Punch test

This commit is contained in:
NightKev 2025-08-04 20:56:59 -07:00
parent 63da1126a7
commit 989cfbc223

View File

@ -9,7 +9,7 @@ import { TurnStartPhase } from "#phases/turn-start-phase";
import { GameManager } from "#test/test-utils/game-manager"; import { GameManager } from "#test/test-utils/game-manager";
import i18next from "i18next"; import i18next from "i18next";
import Phaser from "phaser"; import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
describe("Moves - Focus Punch", () => { describe("Moves - Focus Punch", () => {
let phaserGame: Phaser.Game; let phaserGame: Phaser.Game;
@ -125,8 +125,8 @@ describe("Moves - Focus Punch", () => {
game.move.select(MoveId.FOCUS_PUNCH); game.move.select(MoveId.FOCUS_PUNCH);
await game.phaseInterceptor.to("MoveEndPhase", true); await game.phaseInterceptor.to("MoveEndPhase", true);
await game.phaseInterceptor.to("MessagePhase", false); await game.phaseInterceptor.to("MessagePhase", false);
const consoleSpy = vi.spyOn(console, "log");
await game.phaseInterceptor.to("MoveEndPhase", true); await game.phaseInterceptor.to("MoveEndPhase", true);
expect(consoleSpy).nthCalledWith(1, i18next.t("moveTriggers:lostFocus", { pokemonName: "Charizard" })); expect(game.textInterceptor.logs).toContain(i18next.t("moveTriggers:lostFocus", { pokemonName: "Charizard" }));
expect(game.textInterceptor.logs).not.toContain(i18next.t("battle:attackFailed"));
}); });
}); });