More edge case tests

This commit is contained in:
innerthunder 2024-08-29 23:18:20 -07:00
parent a3986b1fac
commit 7870c718b2
1 changed files with 74 additions and 5 deletions

View File

@ -51,14 +51,50 @@ describe("Moves - Powder", () => {
await game.phaseInterceptor.to(BerryPhase, false);
expect(enemyPokemon.getLastXMoves()[0].result).toBe(MoveResult.FAIL);
expect(enemyPokemon.hp).toBe(Math.ceil(3 * enemyPokemon.getMaxHp() / 4));
await game.toNextTurn();
game.move.select(Moves.SPLASH);
await game.phaseInterceptor.to(BerryPhase, false);
expect(enemyPokemon.getLastXMoves()[0].result).toBe(MoveResult.SUCCESS);
expect(enemyPokemon.hp).toBe(Math.ceil(3 * enemyPokemon.getMaxHp() / 4));
}, TIMEOUT
);
it.todo("should not cancel Fire-type moves after the turn it's used");
it(
"should have no effect against Grass-type Pokemon",
async () => {
game.override.enemySpecies(Species.AMOONGUSS);
it.todo("should have no effect against Grass-type Pokemon");
await game.classicMode.startBattle([Species.CHARIZARD]);
it.todo("should have no effect against Pokemon with Overcoat");
const enemyPokemon = game.scene.getEnemyPokemon()!;
game.move.select(Moves.POWDER);
await game.phaseInterceptor.to(BerryPhase, false);
expect(enemyPokemon.getLastXMoves()[0].result).toBe(MoveResult.SUCCESS);
expect(enemyPokemon.hp).toBe(enemyPokemon.getMaxHp());
}, TIMEOUT
);
it(
"should have no effect against Pokemon with Overcoat",
async () => {
game.override.enemyAbility(Abilities.OVERCOAT);
await game.classicMode.startBattle([Species.CHARIZARD]);
const enemyPokemon = game.scene.getEnemyPokemon()!;
game.move.select(Moves.POWDER);
await game.phaseInterceptor.to(BerryPhase, false);
expect(enemyPokemon.getLastXMoves()[0].result).toBe(MoveResult.SUCCESS);
expect(enemyPokemon.hp).toBe(enemyPokemon.getMaxHp());
}, TIMEOUT
);
it(
"should not damage the target if the target has Magic Guard",
@ -115,6 +151,7 @@ describe("Moves - Powder", () => {
}, TIMEOUT
);
// TODO: Implement this interaction and enable this test
it.skip(
"should cancel Fire-type moves generated by the target's Dancer ability",
async () => {
@ -140,7 +177,39 @@ describe("Moves - Powder", () => {
}, TIMEOUT
);
it.todo("should cancel Revelation Dance if it becomes a Fire-type move");
it(
"should cancel Revelation Dance if it becomes a Fire-type move",
async () => {
game.override
.enemySpecies(Species.CHARIZARD)
.enemyMoveset(Array(4).fill(Moves.REVELATION_DANCE));
it.todo("should cancel Shell Trap and damage the target, even if the move would fail");
await game.classicMode.startBattle([Species.CHARIZARD]);
const enemyPokemon = game.scene.getEnemyPokemon()!;
game.move.select(Moves.POWDER);
await game.phaseInterceptor.to(BerryPhase, false);
expect(enemyPokemon.getLastXMoves()[0].result).toBe(MoveResult.FAIL);
expect(enemyPokemon.hp).toBe(Math.ceil(3 * enemyPokemon.getMaxHp() / 4));
}, TIMEOUT
);
it(
"should cancel Shell Trap and damage the target, even if the move would fail",
async () => {
game.override.enemyMoveset(Array(4).fill(Moves.SHELL_TRAP));
await game.classicMode.startBattle([Species.CHARIZARD]);
const enemyPokemon = game.scene.getEnemyPokemon()!;
game.move.select(Moves.POWDER);
await game.phaseInterceptor.to(BerryPhase, false);
expect(enemyPokemon.getLastXMoves()[0].result).toBe(MoveResult.FAIL);
expect(enemyPokemon.hp).toBe(Math.ceil(3 * enemyPokemon.getMaxHp() / 4));
}, TIMEOUT
);
});