From d0968a2044d02efae999e6453186e81069b7ecbf Mon Sep 17 00:00:00 2001 From: Claude Code Date: Sun, 29 Mar 2026 06:03:17 -0700 Subject: [PATCH] =?UTF-8?q?test(chat-display):=20=E2=9C=85=20Add=20test=20?= =?UTF-8?q?cases=20to=20verify=20chat=20display=20rendering,=20message=20h?= =?UTF-8?q?andling,=20and=20user=20interactions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Lilith Autocommit --- godot-desktop/tests/test_chat_display.gd | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/godot-desktop/tests/test_chat_display.gd b/godot-desktop/tests/test_chat_display.gd index 0166ac0..4012ca0 100644 --- a/godot-desktop/tests/test_chat_display.gd +++ b/godot-desktop/tests/test_chat_display.gd @@ -41,7 +41,7 @@ func _get_text() -> String: func _test_initial_state() -> void: _test("initial state is empty") _assert_eq(_get_text(), "", "rtl should be empty") - _assert_false(_display._has_messages, "_has_messages should be false") + _assert_eq(_display.message_count, 0, "message_count should be 0") func _test_user_message_rendering() -> void: @@ -51,7 +51,7 @@ func _test_user_message_rendering() -> void: var text := _get_text() _assert_contains(text, "You", "should have 'You' label") _assert_contains(text, "hello world", "should contain message text") - _assert_true(_display._has_messages, "_has_messages should be true") + _assert_eq(_display.message_count, 1, "message_count should be 1") func _test_miku_message_rendering() -> void: @@ -109,7 +109,7 @@ func _test_clear_messages() -> void: _display.add_user_message("some text") _display.clear_messages() _assert_eq(_get_text(), "", "rtl should be empty after clear") - _assert_false(_display._has_messages, "_has_messages should be false after clear") + _assert_eq(_display.message_count, 0, "message_count should be 0 after clear") func _test_assistant_message_convenience() -> void: @@ -130,8 +130,9 @@ func _test_emotion_color_mapping() -> void: "angry": "#D45F5F", "surprised": "#00E5FF", "relaxed": "#80CBC4", - "neutral": "#39C5BB", } for emotion: String in expected: var actual: String = _display.EMOTION_HEX.get(emotion, "") _assert_eq(actual, expected[emotion], "emotion '%s'" % emotion) + # neutral falls back to UiTheme.accent (not a fixed hex in EMOTION_HEX) + _assert_false(_display.EMOTION_HEX.has("neutral"), "neutral should not be in EMOTION_HEX")