feat(shell): SystemDock slide-in with inert screen-routing seam
This commit is contained in:
32
client/tests/unit/test_system_dock.gd
Normal file
32
client/tests/unit/test_system_dock.gd
Normal file
@@ -0,0 +1,32 @@
|
||||
extends "res://addons/gut/test.gd"
|
||||
|
||||
const SCENE := "res://scenes/shell/SystemDock.tscn"
|
||||
|
||||
|
||||
func _dock() -> SystemDock:
|
||||
var d = load(SCENE).instantiate()
|
||||
add_child_autofree(d) # _ready() builds the buttons
|
||||
return d
|
||||
|
||||
|
||||
func test_builds_all_six_screen_buttons():
|
||||
var d := _dock()
|
||||
assert_eq(d._screen_buttons.size(), 6)
|
||||
assert_true(d._screen_buttons.has(&"spellbook"), "spellbook kept for mock fidelity")
|
||||
assert_true(d._screen_buttons.has(&"party"))
|
||||
|
||||
|
||||
func test_pressing_a_button_emits_its_id():
|
||||
var d := _dock()
|
||||
watch_signals(d)
|
||||
d._screen_buttons[&"inventory"].emit_signal("pressed")
|
||||
assert_signal_emitted_with_parameters(d, "screen_requested", [&"inventory"])
|
||||
|
||||
|
||||
func test_handle_toggles_state():
|
||||
var d := _dock()
|
||||
var state := ShellState.seed()
|
||||
d.setup(state)
|
||||
assert_true(state.dock_open)
|
||||
d._on_handle_pressed()
|
||||
assert_false(state.dock_open, "handle flips the shared state")
|
||||
1
client/tests/unit/test_system_dock.gd.uid
Normal file
1
client/tests/unit/test_system_dock.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://dllvm2kmia00h
|
||||
Reference in New Issue
Block a user