Add direct reducer tests for encounterReducer

Exports encounterReducer and EncounterState for testing. Adds 26
pure-function tests covering all action types: CRUD, turn navigation,
HP/AC/conditions, undo/redo, bestiary add with auto-numbering,
player character add, import, and event accumulation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Lukas
2026-03-28 18:50:45 +01:00
parent 80dd68752e
commit d8c8a0c44d
2 changed files with 418 additions and 2 deletions

View File

@@ -81,7 +81,7 @@ type EncounterAction =
undoRedoState: UndoRedoState;
};
interface EncounterState {
export interface EncounterState {
readonly encounter: Encounter;
readonly undoRedoState: UndoRedoState;
readonly events: readonly DomainEvent[];
@@ -268,7 +268,7 @@ function handleAddFromPlayerCharacter(
// -- Reducer --
function encounterReducer(
export function encounterReducer(
state: EncounterState,
action: EncounterAction,
): EncounterState {