Added test for status moves

This commit is contained in:
Bertie690 2025-06-06 13:52:02 -04:00
parent 3a85c7830e
commit f49e4d647e

View File

@ -31,7 +31,7 @@ describe("Abilities - Rattled", () => {
.battleType(BattleType.TRAINER)
.disableCrits()
.battleStyle("single")
.enemySpecies(SpeciesId.MAGIKARP)
.enemySpecies(SpeciesId.DUSKULL)
.enemyAbility(AbilityId.INTIMIDATE)
.enemyPassiveAbility(AbilityId.NO_GUARD);
});
@ -66,6 +66,25 @@ describe("Abilities - Rattled", () => {
expect(game.textInterceptor.logs.filter(t => t === statChangeText)).toHaveLength(enemyHits);
});
it.each<{ type: string; move: MoveId }>([
{ type: "Bug", move: MoveId.POWDER },
{ type: "Ghost", move: MoveId.CONFUSE_RAY },
{ type: "Dark", move: MoveId.TAUNT },
])("should not trigger from $type-type status moves", async ({ move }) => {
game.override.enemyAbility(AbilityId.BALL_FETCH);
await game.classicMode.startBattle([SpeciesId.GIMMIGHOUL]);
game.move.use(MoveId.SPLASH);
await game.move.forceEnemyMove(move);
await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]);
await game.phaseInterceptor.to("MoveEndPhase");
const gimmighoul = game.field.getPlayerPokemon();
expect(gimmighoul.getStatStage(Stat.SPD)).toBe(0);
expect(game.phaseInterceptor.log).not.toContain("ShowAbilityPhase");
expect(game.phaseInterceptor.log).not.toContain("StatStageChangePhase");
});
it("should activate after Intimidate attack drop on initial send out", async () => {
// `runToSummon` used instead of `startBattle` to avoid skipping past initial "post send out" effects
await game.classicMode.runToSummon([SpeciesId.GIMMIGHOUL]);