feat: add sortie contribution feedback
This commit is contained in:
@@ -35,6 +35,19 @@ try {
|
||||
assert(normalizeBattleSaveSlot(Number.NaN, 3) === 1, 'Expected NaN slot to normalize to slot 1.');
|
||||
assert(normalizeBattleSaveSlot(99, 3) === 3, 'Expected overflowing slot to clamp to slot count.');
|
||||
assert(isValidBattleSaveState(validState, options), 'Expected valid battle save to pass validation.');
|
||||
const validSortieStatsState = {
|
||||
...validState,
|
||||
battleStats: {
|
||||
'liu-bei': {
|
||||
...validState.battleStats['liu-bei'],
|
||||
sortieBonusDamage: 4,
|
||||
sortiePreventedDamage: 3,
|
||||
sortieBonusHealing: 2,
|
||||
sortieExtendedBondTriggers: 1
|
||||
}
|
||||
}
|
||||
};
|
||||
assert(isValidBattleSaveState(validSortieStatsState, options), 'Expected sortie contribution stats to pass validation.');
|
||||
assert(parseBattleSaveState(JSON.stringify(validState), options)?.battleId === options.expectedBattleId, 'Expected valid JSON save to parse.');
|
||||
assert(parseBattleSaveState('{', options) === undefined, 'Expected malformed JSON to be ignored.');
|
||||
assert(parseBattleSaveState('', options) === undefined, 'Expected empty save payload to be ignored.');
|
||||
@@ -122,6 +135,8 @@ try {
|
||||
['invalid stats shape', { battleStats: { 'liu-bei': { damageDealt: 10 } } }],
|
||||
['invalid stats value', { battleStats: { 'liu-bei': { ...validState.battleStats['liu-bei'], actions: 1.5 } } }],
|
||||
['too high stats value', { battleStats: { 'liu-bei': { ...validState.battleStats['liu-bei'], damageDealt: 1000000 } } }],
|
||||
['invalid sortie stats value', { battleStats: { 'liu-bei': { ...validState.battleStats['liu-bei'], sortieBonusDamage: -1 } } }],
|
||||
['too high sortie stats value', { battleStats: { 'liu-bei': { ...validState.battleStats['liu-bei'], sortieExtendedBondTriggers: 1000000 } } }],
|
||||
['unknown stats unit id', { battleStats: { 'ghost-unit': validState.battleStats['liu-bei'] } }],
|
||||
['invalid enemy usable keys', { enemyUsableUseKeys: [1] }],
|
||||
['malformed enemy usable key', { enemyUsableUseKeys: ['rebel-1:shout'] }],
|
||||
|
||||
Reference in New Issue
Block a user