Fixed tests for lure abilities to account for double lures

This commit is contained in:
Wlowscha 2025-02-20 10:58:53 +01:00
parent 7258a15a7b
commit da70d864b0
No known key found for this signature in database
GPG Key ID: 3C8F1AD330565D04
4 changed files with 48 additions and 8 deletions

View File

@ -57,15 +57,25 @@ describe("Abilities - Arena Trap", () => {
vi.spyOn(game.scene, "getDoubleBattleChance");
await game.classicMode.startBattle();
let expected: number = 8;
game.move.select(Moves.SPLASH);
if (game.scene.currentBattle.double) {
game.move.select(Moves.SPLASH);
expected = 2;
}
await game.doKillOpponents();
await game.toNextWave();
expect(game.scene.getDoubleBattleChance).toHaveLastReturnedWith(8);
expect(game.scene.getDoubleBattleChance).toHaveLastReturnedWith(expected);
expected = 2;
game.move.select(Moves.SPLASH);
if (game.scene.currentBattle.double) {
game.move.select(Moves.SPLASH);
expected = 1;
}
await game.doKillOpponents();
await game.toNextWave();
expect(game.scene.getDoubleBattleChance).toHaveLastReturnedWith(2);
expect(game.scene.getDoubleBattleChance).toHaveLastReturnedWith(expected);
});
/**

View File

@ -254,14 +254,24 @@ describe("Abilities - Commander", () => {
vi.spyOn(game.scene, "getDoubleBattleChance");
await game.classicMode.startBattle();
let expected: number = 8;
game.move.select(Moves.SPLASH);
if (game.scene.currentBattle.double) {
game.move.select(Moves.SPLASH);
expected = 2;
}
await game.doKillOpponents();
await game.toNextWave();
expect(game.scene.getDoubleBattleChance).toHaveLastReturnedWith(8);
expect(game.scene.getDoubleBattleChance).toHaveLastReturnedWith(expected);
expected = 2;
game.move.select(Moves.SPLASH);
if (game.scene.currentBattle.double) {
game.move.select(Moves.SPLASH);
expected = 1;
}
await game.doKillOpponents();
await game.toNextWave();
expect(game.scene.getDoubleBattleChance).toHaveLastReturnedWith(2);
expect(game.scene.getDoubleBattleChance).toHaveLastReturnedWith(expected);
});
});

View File

@ -57,14 +57,24 @@ describe("Abilities - Illuminate", () => {
vi.spyOn(game.scene, "getDoubleBattleChance");
await game.classicMode.startBattle();
let expected: number = 8;
game.move.select(Moves.SPLASH);
if (game.scene.currentBattle.double) {
game.move.select(Moves.SPLASH);
expected = 2;
}
await game.doKillOpponents();
await game.toNextWave();
expect(game.scene.getDoubleBattleChance).toHaveLastReturnedWith(8);
expect(game.scene.getDoubleBattleChance).toHaveLastReturnedWith(expected);
expected = 2;
game.move.select(Moves.SPLASH);
if (game.scene.currentBattle.double) {
game.move.select(Moves.SPLASH);
expected = 1;
}
await game.doKillOpponents();
await game.toNextWave();
expect(game.scene.getDoubleBattleChance).toHaveLastReturnedWith(2);
expect(game.scene.getDoubleBattleChance).toHaveLastReturnedWith(expected);
});
});

View File

@ -66,15 +66,25 @@ describe("Abilities - No Guard", () => {
vi.spyOn(game.scene, "getDoubleBattleChance");
await game.classicMode.startBattle();
let expected: number = 8;
game.move.select(Moves.SPLASH);
if (game.scene.currentBattle.double) {
game.move.select(Moves.SPLASH);
expected = 2;
}
await game.doKillOpponents();
await game.toNextWave();
expect(game.scene.getDoubleBattleChance).toHaveLastReturnedWith(8);
expect(game.scene.getDoubleBattleChance).toHaveLastReturnedWith(expected);
expected = 2;
game.move.select(Moves.SPLASH);
if (game.scene.currentBattle.double) {
game.move.select(Moves.SPLASH);
expected = 1;
}
await game.doKillOpponents();
await game.toNextWave();
expect(game.scene.getDoubleBattleChance).toHaveLastReturnedWith(2);
expect(game.scene.getDoubleBattleChance).toHaveLastReturnedWith(expected);
});
});