diff --git a/src/test/moves/forests_curse.test.ts b/src/test/moves/forests_curse.test.ts index 0fb5b276583..dca2c98732f 100644 --- a/src/test/moves/forests_curse.test.ts +++ b/src/test/moves/forests_curse.test.ts @@ -1,11 +1,12 @@ import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; +import { Type } from "#app/data/type"; import GameManager from "#test/utils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; -describe("Moves - Forests Curse", () => { +describe("Moves - Forest's Curse", () => { let phaserGame: Phaser.Game; let game: GameManager; @@ -22,7 +23,7 @@ describe("Moves - Forests Curse", () => { beforeEach(() => { game = new GameManager(phaserGame); game.override - .moveset([ Moves.SPLASH ]) + .moveset([ Moves.FORESTS_CURSE, Moves.TRICK_OR_TREAT ]) .ability(Abilities.BALL_FETCH) .battleType("single") .disableCrits() @@ -31,12 +32,16 @@ describe("Moves - Forests Curse", () => { .enemyMoveset(Moves.SPLASH); }); - it("should do X", async () => { + it("Using Forest's Curse on a Pokemon affected by Trick Or Treat will replace the Ghost-type with Grass", async () => { await game.classicMode.startBattle([ Species.FEEBAS ]); - game.move.select(Moves.SPLASH); - await game.phaseInterceptor.to("BerryPhase"); + const enemyPokemon = game.scene.getEnemyPokemon(); + game.move.select(Moves.TRICK_OR_TREAT); + await game.phaseInterceptor.to("TurnEndPhase"); + expect(enemyPokemon!.summonData.addedType).toBe(Type.GHOST); - expect(true).toBe(true); + game.move.select(Moves.FORESTS_CURSE); + await game.phaseInterceptor.to("TurnEndPhase"); + expect(enemyPokemon?.summonData.addedType).toBe(Type.GRASS); }); }); diff --git a/src/test/moves/trick_or_treat.test.ts b/src/test/moves/trick_or_treat.test.ts new file mode 100644 index 00000000000..309ab69375c --- /dev/null +++ b/src/test/moves/trick_or_treat.test.ts @@ -0,0 +1,47 @@ +import { Abilities } from "#enums/abilities"; +import { Moves } from "#enums/moves"; +import { Species } from "#enums/species"; +import { Type } from "#app/data/type"; +import GameManager from "#test/utils/gameManager"; +import Phaser from "phaser"; +import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; + +describe("Moves - Trick Or Treat", () => { + let phaserGame: Phaser.Game; + let game: GameManager; + + beforeAll(() => { + phaserGame = new Phaser.Game({ + type: Phaser.HEADLESS, + }); + }); + + afterEach(() => { + game.phaseInterceptor.restoreOg(); + }); + + beforeEach(() => { + game = new GameManager(phaserGame); + game.override + .moveset([ Moves.FORESTS_CURSE, Moves.TRICK_OR_TREAT ]) + .ability(Abilities.BALL_FETCH) + .battleType("single") + .disableCrits() + .enemySpecies(Species.MAGIKARP) + .enemyAbility(Abilities.BALL_FETCH) + .enemyMoveset(Moves.SPLASH); + }); + + it("Using Trick Or Treat on a Pokemon affected by Forest's Curse will replace the Grass-type with Ghost", async () => { + await game.classicMode.startBattle([ Species.FEEBAS ]); + + const enemyPokemon = game.scene.getEnemyPokemon(); + game.move.select(Moves.FORESTS_CURSE); + await game.phaseInterceptor.to("TurnEndPhase"); + expect(enemyPokemon!.summonData.addedType).toBe(Type.GRASS); + + game.move.select(Moves.TRICK_OR_TREAT); + await game.phaseInterceptor.to("TurnEndPhase"); + expect(enemyPokemon?.summonData.addedType).toBe(Type.GHOST); + }); +});