test: follow batched battle event helper
This commit is contained in:
@@ -26,9 +26,18 @@ assert.match(completeEvent, /this\.battleEventQueue\.splice\(0\)/, 'closing the
|
||||
assert.match(completeEvent, /this\.triggeredBattleEvents\.add\(groupedEvent\.key\)/, 'grouped notices recorded in the battle log must complete with the visible banner');
|
||||
|
||||
const checkEvents = privateMethodBody(battleSource, 'checkBattleEvents');
|
||||
assert.match(checkEvents, /this\.deferBattleEventPresentation = true/, 'one action must collect every newly satisfied event before choosing what to show');
|
||||
assert.match(checkEvents, /this\.collectBattleEvents\(\)/, 'one action must collect event candidates as a batch');
|
||||
assert.match(checkEvents, /this\.deferBattleEventPresentation = false/, 'event presentation deferral must always be released');
|
||||
const collectEventsWithoutPresentation = privateMethodBody(
|
||||
battleSource,
|
||||
'collectBattleEventsWithoutPresentation'
|
||||
);
|
||||
assert.match(
|
||||
checkEvents,
|
||||
/this\.collectBattleEventsWithoutPresentation\(\)/,
|
||||
'one action must collect every newly satisfied event before choosing what to show'
|
||||
);
|
||||
assert.match(collectEventsWithoutPresentation, /this\.deferBattleEventPresentation = true/);
|
||||
assert.match(collectEventsWithoutPresentation, /this\.collectBattleEvents\(\)/, 'one action must collect event candidates as a batch');
|
||||
assert.match(collectEventsWithoutPresentation, /finally[\s\S]*this\.deferBattleEventPresentation = false/, 'event presentation deferral must always be released');
|
||||
assert.match(checkEvents, /this\.showNextBattleEvent\(\)/, 'one action may present the highest-priority queued notice after collection');
|
||||
|
||||
const clearEvents = privateMethodBody(battleSource, 'clearBattleEvents');
|
||||
|
||||
Reference in New Issue
Block a user