From 4d092dd908c4d982433fe521a8f1c8deebd2f10c Mon Sep 17 00:00:00 2001 From: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com> Date: Tue, 20 May 2025 18:30:00 -0500 Subject: [PATCH] Add test for forecast --- test/abilities/forecast.test.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/abilities/forecast.test.ts b/test/abilities/forecast.test.ts index 8d3a679c917..576a4158e60 100644 --- a/test/abilities/forecast.test.ts +++ b/test/abilities/forecast.test.ts @@ -277,4 +277,19 @@ describe("Abilities - Forecast", () => { expect(castform.formIndex).toBe(NORMAL_FORM); }); + + it("should trigger player's form change when summoned at the same time as an enemy with a weather changing ability", async () => { + // NOTE: The following pairs of tests are intentionally testing the same scenario, switching the player and enemy pokemon + // as this is a regression test where the order of player and enemy mattered. + game.override.enemyAbility(AbilityId.DROUGHT); + await game.classicMode.startBattle([SpeciesId.CASTFORM, SpeciesId.MAGIKARP]); + const castform = game.scene.getPlayerPokemon()!; + expect(castform.formIndex).toBe(SUNNY_FORM); + }); + it("should trigger enemy's form change when summoned at the same time as a player with a weather changing ability", async () => { + game.override.ability(AbilityId.DROUGHT).enemySpecies(SpeciesId.CASTFORM); + await game.classicMode.startBattle([SpeciesId.MAGIKARP]); + const castform = game.scene.getEnemyPokemon()!; + expect(castform.formIndex).toBe(SUNNY_FORM); + }); });