test: cover native chat chrome transitions

This commit is contained in:
kris
2026-03-28 08:47:55 +08:00
parent d2291af32c
commit 64ad401d0c
2 changed files with 123 additions and 10 deletions

View File

@@ -0,0 +1,57 @@
package com.hyzq.boss;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
public class ProjectDetailActivityChromeBindingsTest {
@Test
public void multiSelectBindingsHideComposerAndDisableRefresh() {
ProjectChatUiState.SelectionState selectionState = ProjectChatUiState.selectOnly("m1");
selectionState = ProjectChatUiState.toggleSelection(selectionState, "m2");
ProjectChatUiState.ChromeState chromeState = ProjectChatUiState.resolveChromeState(
selectionState,
true,
"北区试产线回归",
"归档确认"
);
ProjectDetailActivity.ChromeBindings bindings =
ProjectDetailActivity.buildChromeBindings(chromeState, false);
assertTrue(bindings.multiSelecting);
assertFalse(bindings.showComposer);
assertTrue(bindings.showMultiSelectBar);
assertFalse(bindings.showRefresh);
assertFalse(bindings.showHeaderAction);
assertTrue(bindings.enableForwardButton);
assertFalse(bindings.enablePullRefresh);
assertEquals("取消", bindings.backLabel);
}
@Test
public void normalBindingsRestoreConversationChrome() {
ProjectChatUiState.ChromeState chromeState = ProjectChatUiState.resolveChromeState(
ProjectChatUiState.emptySelection(),
true,
"北区试产线回归",
"归档确认"
);
ProjectDetailActivity.ChromeBindings bindings =
ProjectDetailActivity.buildChromeBindings(chromeState, true);
assertFalse(bindings.multiSelecting);
assertTrue(bindings.showComposer);
assertFalse(bindings.showMultiSelectBar);
assertTrue(bindings.showRefresh);
assertTrue(bindings.showHeaderAction);
assertFalse(bindings.enableForwardButton);
assertTrue(bindings.enablePullRefresh);
assertEquals("返回", bindings.backLabel);
assertEquals("北区试产线回归", bindings.title);
assertEquals("归档确认", bindings.subtitle);
}
}