mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-23 07:49:36 +02:00
Tests: Added checks for correct number of Pokemon on field
This commit is contained in:
parent
6d9c9480b8
commit
a0655a9da5
@ -154,9 +154,10 @@ describe("Moves - Dragon Tail", () => {
|
|||||||
expect(enemy).toBeDefined();
|
expect(enemy).toBeDefined();
|
||||||
expect(enemy.isFullHp()).toBe(true);
|
expect(enemy.isFullHp()).toBe(true);
|
||||||
|
|
||||||
// Make sure the enemy has a fainted Pokemon in their party
|
// Make sure the enemy has a fainted Pokemon in their party and not on the field
|
||||||
const faintedEnemy = game.scene.getEnemyParty().find(p => !p.isAllowedInBattle());
|
const faintedEnemy = game.scene.getEnemyParty().find(p => !p.isAllowedInBattle());
|
||||||
expect(faintedEnemy).toBeDefined();
|
expect(faintedEnemy).toBeDefined();
|
||||||
|
expect(game.scene.getEnemyField().length).toBe(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should not cause a softlock when activating an opponent trainer's reviver seed", async () => {
|
it("should not cause a softlock when activating an opponent trainer's reviver seed", async () => {
|
||||||
@ -173,6 +174,7 @@ describe("Moves - Dragon Tail", () => {
|
|||||||
const enemy = game.scene.getEnemyPokemon()!;
|
const enemy = game.scene.getEnemyPokemon()!;
|
||||||
expect(enemy).toBeDefined();
|
expect(enemy).toBeDefined();
|
||||||
expect(enemy.hp).toBe(Math.floor(enemy.getMaxHp() / 2));
|
expect(enemy.hp).toBe(Math.floor(enemy.getMaxHp() / 2));
|
||||||
|
expect(game.scene.getEnemyField().length).toBe(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should not cause a softlock when activating a player's reviver seed", async () => {
|
it("should not cause a softlock when activating a player's reviver seed", async () => {
|
||||||
@ -189,5 +191,6 @@ describe("Moves - Dragon Tail", () => {
|
|||||||
const dratini = game.scene.getPlayerPokemon()!;
|
const dratini = game.scene.getPlayerPokemon()!;
|
||||||
expect(dratini).toBeDefined();
|
expect(dratini).toBeDefined();
|
||||||
expect(dratini.hp).toBe(Math.floor(dratini.getMaxHp() / 2));
|
expect(dratini.hp).toBe(Math.floor(dratini.getMaxHp() / 2));
|
||||||
|
expect(game.scene.getPlayerField().length).toBe(1);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user