test: add serialization round-trip test (Closes #37) #43

Merged
shahondin1624 merged 1 commits from feature/issue-37-serialization-round-trip-test into main 2026-03-13 13:00:59 +01:00

Summary

  • Add SerializationRoundTripTest with 3 test cases:
    • serializeDeserializePreservesAllFields: custom character with non-default values, asserts deep equality on every field
    • roundTripWithExampleCharacter: round-trip with EXAMPLE_CHARACTER (safe damage values)
    • serializedJsonContainsAllFields: verifies all expected field names present in JSON output
  • Pure unit test, no Compose UI dependencies

Closes #37

Test plan

  • All 3 new tests pass in jsTest
  • Total: 19 tests, 1 pre-existing failure (ComposeTest)
## Summary - Add `SerializationRoundTripTest` with 3 test cases: - `serializeDeserializePreservesAllFields`: custom character with non-default values, asserts deep equality on every field - `roundTripWithExampleCharacter`: round-trip with EXAMPLE_CHARACTER (safe damage values) - `serializedJsonContainsAllFields`: verifies all expected field names present in JSON output - Pure unit test, no Compose UI dependencies Closes #37 ## Test plan - [x] All 3 new tests pass in `jsTest` - [x] Total: 19 tests, 1 pre-existing failure (ComposeTest)
shahondin1624 added 1 commit 2026-03-13 13:00:52 +01:00
Verify serialize/deserialize preserves all CharacterData, Attributes,
Talents, and DamageMonitor fields. Includes non-default values test,
EXAMPLE_CHARACTER round-trip, and JSON field presence check.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
shahondin1624 merged commit 8855f48ae2 into main 2026-03-13 13:00:59 +01:00
shahondin1624 deleted branch feature/issue-37-serialization-round-trip-test 2026-03-13 13:00:59 +01:00
Sign in to join this conversation.