test(client): align test_character_creation_sprint28 to 4-tab structure
W5 restructured character_creation's TabContainer to 4 top-level tabs (Bookmark, Appearance, Skills, Debug) from the old 5-tab flat layout. Three assertions in test_character_creation_sprint28.gd still referred to the old shape; they didn't fail because the suite runs vacuously in headless (the 3D SubViewport scene can't instantiate without a render context), but the assertions were stale and would fire wrong once the suite eventually runs non-headless. Fixed: - test_tab_container_has_five_tabs → renamed test_tab_container_ has_four_tabs, expected count 5 → 4. - test_tab_names: expected ["Body","Head","Hair","Clothing","Debug"] → ["Bookmark","Appearance","Skills","Debug"] - test_tab_navigation_wraps: current_tab = 4 (invalid on a 4-tab container) → 3. Header note added documenting the vacuous-headless behavior so the suite reads correctly. 88/88 pass — unchanged — but the assertions are now correct for non-headless invocation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,11 +1,14 @@
|
||||
## Sprint 28 — Character creation screen tests (#705, Task #9)
|
||||
## Updated sprint 36: W5/W6 restructure — 4-tab layout (Bookmark/Appearance/Skills/Debug),
|
||||
## CharacterProfile signal type (#618/#680).
|
||||
##
|
||||
## Validates the CharacterCreation UI: scene instantiation, tab structure,
|
||||
## signal emission (creation_confirmed / creation_cancelled), keyboard nav
|
||||
## callbacks, randomize, color derivation helpers, and game flow wiring.
|
||||
##
|
||||
## These are UI-only tests (no compositor/server required).
|
||||
## CharacterVisual asset paths fall back gracefully when GLBs are absent.
|
||||
## NOTE: All tests run vacuously in headless — the 3D SubViewport scene cannot
|
||||
## instantiate without a rendering context. Tests return early on _scene == null.
|
||||
## Run non-headless for full coverage.
|
||||
##
|
||||
## Ticket: #705 | D-146, D-155, D-158, D-159, D-165
|
||||
class_name TestCharacterCreationSprint28
|
||||
@@ -51,7 +54,8 @@ func test_scene_is_character_creation_class() -> void:
|
||||
).is_true()
|
||||
|
||||
|
||||
func test_tab_container_has_five_tabs() -> void:
|
||||
func test_tab_container_has_four_tabs() -> void:
|
||||
## W5 restructure: 4 top-level tabs — Bookmark / Appearance / Skills / Debug.
|
||||
if _scene == null:
|
||||
return
|
||||
var tc: TabContainer = _scene.get_node_or_null("Layout/TabPanel/TabContainer")
|
||||
@@ -59,17 +63,19 @@ func test_tab_container_has_five_tabs() -> void:
|
||||
if tc == null:
|
||||
return
|
||||
assert_int(tc.get_tab_count()).override_failure_message(
|
||||
"TabContainer must have exactly 5 tabs (Body/Head/Hair/Clothing/Accessories)"
|
||||
).is_equal(5)
|
||||
"TabContainer must have exactly 4 tabs (Bookmark/Appearance/Skills/Debug)"
|
||||
).is_equal(4)
|
||||
|
||||
|
||||
func test_tab_names() -> void:
|
||||
## W5 restructure: top-level tabs are Bookmark/Appearance/Skills/Debug.
|
||||
## Appearance sub-nav (Body/Head/Hair/Clothing/Accessories) is inside the Appearance tab.
|
||||
if _scene == null:
|
||||
return
|
||||
var tc: TabContainer = _scene.get_node_or_null("Layout/TabPanel/TabContainer")
|
||||
if tc == null:
|
||||
return
|
||||
var expected := ["Body", "Head", "Hair", "Clothing", "Accessories"]
|
||||
var expected := ["Bookmark", "Appearance", "Skills", "Debug"]
|
||||
for i in expected.size():
|
||||
assert_str(tc.get_tab_title(i)).override_failure_message(
|
||||
"Tab %d must be named '%s'" % [i, expected[i]]
|
||||
@@ -411,7 +417,7 @@ func test_tab_navigation_wraps() -> void:
|
||||
var tc: TabContainer = _scene.get_node_or_null("Layout/TabPanel/TabContainer")
|
||||
if tc == null:
|
||||
return
|
||||
tc.current_tab = 4 # last tab
|
||||
tc.current_tab = 3 # last tab (Debug, index 3 of 4)
|
||||
# Simulate Tab key forward — wraps to 0
|
||||
var event := InputEventKey.new()
|
||||
event.keycode = KEY_TAB
|
||||
|
||||
Reference in New Issue
Block a user