test(t5-hotfix): 奖励节点 UI 直验套件转正——池空直通/全列呈现/强制选择/item_chosen 外发四断言(探针盲区补漏,run_all manifest+1);hotfix 后冒烟 577/0+直验 PASS

This commit is contained in:
DKChan committed 2026-09-29 15:12:36 +08:00
1 parent 6673bbba5f
commit dbc6908bf6
2 files changed
+42

No files matched your search

+1
View File
@@ -33,6 +33,7 @@ func _suites() -> Array:
{"path": "res://tests/unit/data_config/reward_dangling_aux_test.gd", "expect": 1}, # 迭代 7 T1——aux 双表校验
{"path": "res://tests/unit/data_config/rng_service_test.gd", "expect": 0},
{"path": "res://tests/unit/core/aux_items_test.gd", "expect": 0}, # 迭代 7 T7——魔法道具结构冻结断言面
{"path": "res://tests/unit/presentation/reward_overlay_test.gd", "expect": 0}, # 迭代 7 hotfix——奖励节点 UI 直验(盲区补漏)
{"path": "res://tests/unit/battle_settlement/damage_math_test.gd", "expect": 0},
{"path": "res://tests/unit/battle_settlement/damage_controller_test.gd", "expect": 0},
{"path": "res://tests/unit/contracts/system_contracts_test.gd", "expect": 0},
@@ -0,0 +1,41 @@
extends SceneTree
# 奖励节点三选一 UI 直验套件(迭代 7 T5-hotfix 转正——奖励节点 UI 无探针路径触达的盲区补漏:
# show_reward_items 函数体曾在合并中丢失而全闸绿灯实机炸——「功能存在 ≠ 功能可达」的测试面教训)。
# 运行:godot --headless --path game --script res://tests/unit/presentation/reward_overlay_test.gd(expect 0)
# 覆盖:池空直通态 / 全列呈现按钮数 / 强制选择(继续隐藏)/ item_chosen 信号外发。
func _initialize() -> void:
call_deferred("_run")
func _run() -> void:
var ov = load("res://presentation/views/node_overlay.gd").new()
root.add_child(ov)
var called := []
ov.item_chosen.connect(func(id: String): called.append(id))
ov.show_reward_items([])
if ov.visible != true or ov._btn.visible != true:
print("[reward_verify] FAIL — 池空态应为直通确认(visible/继续可见)")
quit(1)
return
ov.close_reward()
ov.show_reward_items([
{"item_id": "sapper_order", "display_name": "工兵令", "glyph": "工"},
{"item_id": "nest_pendulum", "display_name": "探巢摆钟", "glyph": "摆"},
])
var btns := 0
for c in ov._choice_box.get_children():
if c is Button:
btns += 1
if btns != 2 or ov._btn.visible:
print("[reward_verify] FAIL — 两件应呈现两按钮且继续隐藏(btns=%d 继续可见=%s)" % [btns, str(ov._btn.visible)])
quit(1)
return
for c in ov._choice_box.get_children():
if c is Button:
c.pressed.emit()
break
if called.size() != 1 or String(called[0]) != "sapper_order":
print("[reward_verify] FAIL — 选择未外发 item_chosen(%s)" % str(called))
quit(1)
return
print("[reward_verify] PASS — 池空直通/全列呈现/强制选择/选择外发 全过")
quit(0)