Fixed corrosion test

This commit is contained in:
Bertie690 2025-06-17 16:42:27 -04:00
parent 903d1a33dd
commit fefa8e408f

View File

@ -26,22 +26,25 @@ describe("Abilities - Corrosion", () => {
.battleStyle("single") .battleStyle("single")
.criticalHits(false) .criticalHits(false)
.enemySpecies(SpeciesId.GRIMER) .enemySpecies(SpeciesId.GRIMER)
.enemyAbility(AbilityId.CORROSION) .ability(AbilityId.CORROSION)
.enemyMoveset(MoveId.TOXIC); .enemyAbility(AbilityId.NO_GUARD)
.enemyMoveset(MoveId.SPLASH);
}); });
it.each<{ name: string; species: SpeciesId }>([ it.each<{ name: string; species: SpeciesId }>([
{ name: "Poison", species: SpeciesId.GRIMER }, { name: "Poison", species: SpeciesId.GRIMER },
{ name: "Steel", species: SpeciesId.KLINK }, { name: "Steel", species: SpeciesId.KLINK },
])("should grant the user the ability to poison $name-type opponents", async ({ species }) => { ])("should grant the user the ability to poison $name-type opponents", async ({ species }) => {
await game.classicMode.startBattle([species]); game.override.enemySpecies(species);
await game.classicMode.startBattle([SpeciesId.SALANDIT]);
const enemyPokemon = game.field.getEnemyPokemon(); const enemy = game.field.getEnemyPokemon();
expect(enemyPokemon.status).toBeUndefined(); expect(enemy.status?.effect).toBeUndefined();
game.move.use(MoveId.POISON_GAS); game.move.use(MoveId.POISON_GAS);
await game.phaseInterceptor.to("BerryPhase"); await game.toEndOfTurn();
expect(enemyPokemon.status).toBeDefined();
expect(enemy.status?.effect).toBe(StatusEffect.POISON);
}); });
it("should not affect Toxic Spikes", async () => { it("should not affect Toxic Spikes", async () => {
@ -56,18 +59,18 @@ describe("Abilities - Corrosion", () => {
}); });
it("should not affect an opponent's Synchronize ability", async () => { it("should not affect an opponent's Synchronize ability", async () => {
game.override.ability(AbilityId.SYNCHRONIZE); game.override.enemyAbility(AbilityId.SYNCHRONIZE);
await game.classicMode.startBattle([SpeciesId.ARBOK]); await game.classicMode.startBattle([SpeciesId.ARBOK]);
const playerPokemon = game.field.getPlayerPokemon(); const playerPokemon = game.field.getPlayerPokemon();
const enemyPokemon = game.field.getEnemyPokemon(); const enemyPokemon = game.field.getEnemyPokemon();
expect(enemyPokemon.status?.effect).toBeUndefined(); expect(enemyPokemon.status?.effect).toBeUndefined();
game.move.select(MoveId.TOXIC); game.move.use(MoveId.TOXIC);
await game.toEndOfTurn(); await game.toEndOfTurn();
expect(playerPokemon.status?.effect).toBe(StatusEffect.TOXIC); expect(enemyPokemon.status?.effect).toBe(StatusEffect.TOXIC);
expect(enemyPokemon.status?.effect).toBeUndefined(); expect(playerPokemon.status?.effect).toBeUndefined();
}); });
it("should affect the user's held Toxic Orb", async () => { it("should affect the user's held Toxic Orb", async () => {
@ -79,6 +82,7 @@ describe("Abilities - Corrosion", () => {
game.move.select(MoveId.SPLASH); game.move.select(MoveId.SPLASH);
await game.toNextTurn(); await game.toNextTurn();
expect(salazzle.status?.effect).toBe(StatusEffect.TOXIC); expect(salazzle.status?.effect).toBe(StatusEffect.TOXIC);
}); });
}); });