[Fix] Updated tests to handle the corfirmation box

This commit is contained in:
Tiago Rodrigues 2025-07-24 02:43:35 +01:00
parent d3ca336bef
commit b455214421
2 changed files with 11 additions and 2 deletions

View File

@ -685,6 +685,7 @@ export class PartyUiHandler extends MessageUiHandler {
private doDiscard(option: PartyOption, pokemon: PlayerPokemon) {
const itemModifiers = this.getTransferrableItemsFromPokemon(pokemon);
this.clearOptions();
if (option === PartyOption.ALL) {
for (let i = 0; i < itemModifiers.length; i++) {
@ -693,7 +694,6 @@ export class PartyUiHandler extends MessageUiHandler {
} else {
globalScene.tryDiscardHeldItemModifier(itemModifiers[option], this.transferQuantities[option]);
}
return;
}
private moveOptionCursor(button: Button.UP | Button.DOWN): boolean {

View File

@ -145,10 +145,19 @@ describe("UI - Transfer Items", () => {
await new Promise(r => setTimeout(r, 100));
const handler = game.scene.ui.getHandler() as PartyUiHandler;
handler.processInput(Button.ACTION);
resolve();
});
});
await new Promise<void>(resolve => {
game.onNextPrompt("SelectModifierPhase", UiMode.PARTY, async () => {
await new Promise(r => setTimeout(r, 100));
const handler = game.scene.ui.getHandler() as PartyUiHandler;
handler.processInput(Button.ACTION);
pokemon = game.field.getPlayerPokemon();
handler.processInput(Button.CANCEL);
resolve();
});
});