feat(client): Sprint 2 proof E2E tests + dynamic test snapshot (#357)
Three E2E proof tests verify all acceptance criteria through the real server pipeline: player movement, v2 snapshot with visible_tiles, wall hiding (NPC behind wall invisible), corner reveal (move around wall to see NPC). Dynamic test snapshot tracks player position from queued inputs with simple LOS and Manhattan-distance visibility for standalone demo mode. 88 client + 112 server tests passing. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -123,7 +123,7 @@ func test_game_state_warns_on_missing_player() -> void:
|
||||
# -- SimBridge: test data completeness --
|
||||
|
||||
func test_sim_bridge_test_snapshot_has_tiles() -> void:
|
||||
SimBridge._test_tick = 0
|
||||
SimBridge.reset_test_state()
|
||||
var snap = SimBridge._test_snapshot()
|
||||
assert_that(snap.has("tiles")).is_true()
|
||||
assert_that(snap.tiles.size()).is_greater(0)
|
||||
@@ -133,7 +133,7 @@ func test_sim_bridge_test_snapshot_has_tiles() -> void:
|
||||
assert_that(tile.has("type")).is_true()
|
||||
|
||||
func test_sim_bridge_test_snapshot_has_visible_positions() -> void:
|
||||
SimBridge._test_tick = 0
|
||||
SimBridge.reset_test_state()
|
||||
var snap = SimBridge._test_snapshot()
|
||||
assert_that(snap.has("visible_positions")).is_true()
|
||||
assert_that(snap.visible_positions.size()).is_greater(0)
|
||||
@@ -142,7 +142,7 @@ func test_sim_bridge_test_snapshot_has_visible_positions() -> void:
|
||||
assert_that(pos.has("y")).is_true()
|
||||
|
||||
func test_sim_bridge_test_snapshot_has_player_entity() -> void:
|
||||
SimBridge._test_tick = 0
|
||||
SimBridge.reset_test_state()
|
||||
var snap = SimBridge._test_snapshot()
|
||||
var has_player := false
|
||||
for entity in snap.entities:
|
||||
@@ -152,7 +152,7 @@ func test_sim_bridge_test_snapshot_has_player_entity() -> void:
|
||||
assert_that(has_player).is_true()
|
||||
|
||||
func test_sim_bridge_test_snapshot_has_npc() -> void:
|
||||
SimBridge._test_tick = 0
|
||||
SimBridge.reset_test_state()
|
||||
var snap = SimBridge._test_snapshot()
|
||||
var has_npc := false
|
||||
for entity in snap.entities:
|
||||
@@ -162,7 +162,7 @@ func test_sim_bridge_test_snapshot_has_npc() -> void:
|
||||
assert_that(has_npc).is_true()
|
||||
|
||||
func test_sim_bridge_test_tiles_contain_all_types() -> void:
|
||||
SimBridge._test_tick = 0
|
||||
SimBridge.reset_test_state()
|
||||
var snap = SimBridge._test_snapshot()
|
||||
var types: Dictionary = {}
|
||||
for tile in snap.tiles:
|
||||
@@ -172,7 +172,7 @@ func test_sim_bridge_test_tiles_contain_all_types() -> void:
|
||||
assert_that(types.has("door")).is_true()
|
||||
|
||||
func test_sim_bridge_test_snapshot_has_v2_fields() -> void:
|
||||
SimBridge._test_tick = 0
|
||||
SimBridge.reset_test_state()
|
||||
var snap = SimBridge._test_snapshot()
|
||||
assert_that(snap.has("version")).is_true()
|
||||
assert_that(snap.version).is_equal(2)
|
||||
|
||||
Reference in New Issue
Block a user