From 68ec122fdf41d365507e3ef905277b6951d68855 Mon Sep 17 00:00:00 2001 From: frutescens Date: Mon, 7 Oct 2024 07:42:01 -0700 Subject: [PATCH] Test Cleanup --- src/test/moves/telekinesis.test.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/test/moves/telekinesis.test.ts b/src/test/moves/telekinesis.test.ts index 5429fbe4374..54b328e4acd 100644 --- a/src/test/moves/telekinesis.test.ts +++ b/src/test/moves/telekinesis.test.ts @@ -3,6 +3,7 @@ import { allMoves } from "#app/data/move"; import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; +import { MoveResult } from "#app/field/pokemon"; import GameManager from "#test/utils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, it, expect, vi } from "vitest"; @@ -79,6 +80,7 @@ describe("Moves - Telekinesis", () => { await game.phaseInterceptor.to("TurnEndPhase"); expect(enemyOpponent?.getTag(BattlerTagType.TELEKINESIS)).toBeDefined(); expect(enemyOpponent?.getTag(BattlerTagType.FLOATING)).toBeDefined(); + expect(enemyOpponent?.summonData.speciesForm?.speciesId).toBe(Species.DIGLETT); }); it("Moves like Smack Down and 1000 Arrows remove all effects of Telekinesis from the target Pokemon", async () => { @@ -103,11 +105,12 @@ describe("Moves - Telekinesis", () => { game.override.enemyMoveset([ Moves.SPLASH, Moves.INGRAIN ]); await game.classicMode.startBattle([ Species.MAGIKARP ]); + const playerPokemon = game.scene.getPlayerPokemon(); const enemyOpponent = game.scene.getEnemyPokemon(); expect(enemyOpponent).toBeDefined(); game.move.select(Moves.TELEKINESIS); - game.forceEnemyMove(Moves.SPLASH); + await game.forceEnemyMove(Moves.SPLASH); await game.phaseInterceptor.to("TurnEndPhase"); expect(enemyOpponent?.getTag(BattlerTagType.TELEKINESIS)).toBeDefined(); expect(enemyOpponent?.getTag(BattlerTagType.FLOATING)).toBeDefined(); @@ -115,13 +118,13 @@ describe("Moves - Telekinesis", () => { await game.toNextTurn(); vi.spyOn(allMoves[Moves.MUD_SHOT], "accuracy", "get").mockReturnValue(0); game.move.select(Moves.MUD_SHOT); - game.forceEnemyMove(Moves.INGRAIN); + await game.forceEnemyMove(Moves.INGRAIN); await game.phaseInterceptor.to("TurnEndPhase"); expect(enemyOpponent?.getTag(BattlerTagType.TELEKINESIS)).toBeDefined(); expect(enemyOpponent?.getTag(BattlerTagType.INGRAIN)).toBeDefined(); expect(enemyOpponent?.getTag(BattlerTagType.IGNORE_FLYING)).toBeDefined(); expect(enemyOpponent?.getTag(BattlerTagType.FLOATING)).toBeUndefined(); - expect(enemyOpponent?.hp).toBeLessThan(enemyOpponent!.getMaxHp()); + const lastMoveResult = playerPokemon?.getLastXMoves()[0].result; + expect(lastMoveResult).toBe(MoveResult.SUCCESS); }); - });