feat: polish chat composer feedback

This commit is contained in:
kris
2026-03-27 14:26:57 +08:00
parent 63ceef9871
commit ae571a76ff
4 changed files with 144 additions and 11 deletions

View File

@@ -0,0 +1,23 @@
package com.hyzq.boss;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
public class ProjectChatUiStateTest {
@Test
public void sendEnabled_requiresTextAndNotBusy() {
assertFalse(ProjectChatUiState.canSend("", false));
assertFalse(ProjectChatUiState.canSend(" ", false));
assertFalse(ProjectChatUiState.canSend("你好", true));
assertTrue(ProjectChatUiState.canSend("你好", false));
}
@Test
public void shouldAutoScroll_onlyWhenNearBottomOrForced() {
assertTrue(ProjectChatUiState.shouldAutoScroll(true, false));
assertTrue(ProjectChatUiState.shouldAutoScroll(false, true));
assertFalse(ProjectChatUiState.shouldAutoScroll(false, false));
}
}