mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-11 09:59:28 +02:00
[Fix] Updated tests to handle the corfirmation box
This commit is contained in:
parent
d3ca336bef
commit
b455214421
@ -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 {
|
||||
|
@ -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();
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user