diff --git a/src/test/moves/assist.test.ts b/src/test/moves/assist.test.ts index 6f211e30232..81633d9a277 100644 --- a/src/test/moves/assist.test.ts +++ b/src/test/moves/assist.test.ts @@ -25,8 +25,9 @@ describe("Moves - Assist", () => { beforeEach(() => { game = new GameManager(phaserGame); + // Manual moveset overrides are required for the player pokemon in these tests + // because the normal moveset override doesn't allow for accurate testing of moveset changes game.override - .moveset([ Moves.ASSIST, Moves.SKETCH, Moves.PROTECT, Moves.DRAGON_TAIL ]) // These are all moves Assist cannot call; Sketch will be used to test that it can call other moves properly .ability(Abilities.BALL_FETCH) .battleType("double") .disableCrits() @@ -40,6 +41,11 @@ describe("Moves - Assist", () => { game.override.enemyMoveset(Moves.SWORDS_DANCE); await game.classicMode.startBattle([ Species.FEEBAS, Species.SHUCKLE ]); + const [ feebas, shuckle ] = game.scene.getPlayerField(); + // These are all moves Assist cannot call; Sketch will be used to test that it can call other moves properly + game.move.changeMoveset(feebas, [ Moves.ASSIST, Moves.SKETCH, Moves.PROTECT, Moves.DRAGON_TAIL ]); + game.move.changeMoveset(shuckle, [ Moves.ASSIST, Moves.SKETCH, Moves.PROTECT, Moves.DRAGON_TAIL ]); + game.move.select(Moves.ASSIST, 0); game.move.select(Moves.SKETCH, 1); await game.setTurnOrder([ BattlerIndex.ENEMY, BattlerIndex.ENEMY_2, BattlerIndex.PLAYER_2, BattlerIndex.PLAYER ]); @@ -49,9 +55,12 @@ describe("Moves - Assist", () => { expect(game.scene.getPlayerPokemon()!.getStatStage(Stat.ATK)).toBe(2); // Stat raised from Assist -> Swords Dance }); - it("should fail if there are no usable moves", async () => { + it("should fail if there are no allies", async () => { await game.classicMode.startBattle([ Species.FEEBAS ]); - // Moves in beforeEach are already unusable by Assist + + const feebas = game.scene.getPlayerPokemon()!; + game.move.changeMoveset(feebas, [ Moves.ASSIST, Moves.SKETCH, Moves.PROTECT, Moves.DRAGON_TAIL ]); + game.move.select(Moves.ASSIST, 0); await game.toNextTurn(); expect(game.scene.getPlayerPokemon()!.getLastXMoves()[0].result).toBe(MoveResult.FAIL); @@ -61,6 +70,10 @@ describe("Moves - Assist", () => { game.override.enemyMoveset(Moves.SWORDS_DANCE); await game.classicMode.startBattle([ Species.FEEBAS, Species.SHUCKLE ]); + const [ feebas, shuckle ] = game.scene.getPlayerField(); + game.move.changeMoveset(feebas, [ Moves.ASSIST, Moves.SKETCH, Moves.PROTECT, Moves.DRAGON_TAIL ]); + game.move.changeMoveset(shuckle, [ Moves.ASSIST, Moves.SKETCH, Moves.PROTECT, Moves.DRAGON_TAIL ]); + game.move.select(Moves.SKETCH, 0); game.move.select(Moves.PROTECT, 1); await game.setTurnOrder([ BattlerIndex.ENEMY, BattlerIndex.ENEMY_2, BattlerIndex.PLAYER, BattlerIndex.PLAYER_2 ]); @@ -78,6 +91,10 @@ describe("Moves - Assist", () => { game.override.moveset([ Moves.ASSIST, Moves.WOOD_HAMMER, Moves.WOOD_HAMMER, Moves.WOOD_HAMMER ]); await game.classicMode.startBattle([ Species.FEEBAS, Species.SHUCKLE ]); + const [ feebas, shuckle ] = game.scene.getPlayerField(); + game.move.changeMoveset(feebas, [ Moves.ASSIST, Moves.SKETCH, Moves.PROTECT, Moves.DRAGON_TAIL ]); + game.move.changeMoveset(shuckle, [ Moves.ASSIST, Moves.SKETCH, Moves.PROTECT, Moves.DRAGON_TAIL ]); + game.move.select(Moves.ASSIST, 0); await game.phaseInterceptor.to(CommandPhase); game.move.select(Moves.ASSIST, 1); diff --git a/src/test/moves/metronome.test.ts b/src/test/moves/metronome.test.ts index 6423e4cf6a4..946dc92de0f 100644 --- a/src/test/moves/metronome.test.ts +++ b/src/test/moves/metronome.test.ts @@ -43,7 +43,6 @@ describe("Moves - Metronome", () => { const player = game.scene.getPlayerPokemon()!; const enemy = game.scene.getEnemyPokemon()!; vi.spyOn(randomMoveAttr, "getMoveOverride").mockReturnValue(Moves.DIVE); - vi.spyOn(allMoves[Moves.DIVE], "accuracy", "get").mockReturnValue(100); game.move.select(Moves.METRONOME); await game.toNextTurn(); @@ -109,6 +108,6 @@ describe("Moves - Metronome", () => { const hasFled = enemyPokemon.switchOutStatus; expect(!isVisible && hasFled).toBe(true); - await game.phaseInterceptor.to("BattleEndPhase"); + await game.phaseInterceptor.to("CommandPhase"); }); }); diff --git a/src/test/moves/mirror_move.test.ts b/src/test/moves/mirror_move.test.ts index 7b84762948a..e55c55038ae 100644 --- a/src/test/moves/mirror_move.test.ts +++ b/src/test/moves/mirror_move.test.ts @@ -34,7 +34,7 @@ describe("Moves - Mirror Move", () => { .enemyMoveset(Moves.SPLASH); }); - it("should use the last move that the target", async () => { + it("should use the last move that the target used on the user", async () => { game.override .battleType("double") .enemyMoveset([ Moves.TACKLE, Moves.GROWL ]); diff --git a/src/test/moves/sleep_talk.test.ts b/src/test/moves/sleep_talk.test.ts index 3c001783b2c..9ad2d23f903 100644 --- a/src/test/moves/sleep_talk.test.ts +++ b/src/test/moves/sleep_talk.test.ts @@ -46,7 +46,7 @@ describe("Moves - Sleep Talk", () => { }); it("should fail if the user has no valid moves", async () => { - game.override.moveset([ Moves.SLEEP_TALK, Moves.DIG, Moves.METRONOME, Moves.SOLAR_BEAM, Moves.SLEEP_TALK ]); + game.override.moveset([ Moves.SLEEP_TALK, Moves.DIG, Moves.METRONOME, Moves.SOLAR_BEAM ]); await game.classicMode.startBattle([ Species.FEEBAS ]); game.move.select(Moves.SLEEP_TALK);