style: align group creation list with conversations
This commit is contained in:
@@ -93,6 +93,28 @@ public class GroupCreateActivityTest {
|
||||
assertTrue(GroupCreateActivity.canCreateGroupChat(false, false, linkedSet("thread-1", "thread-2"), false));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void toCandidateConversationRow_usesConversationCardChromeAndSelectedBadge() {
|
||||
JSONObject item = new StubJSONObject()
|
||||
.withString("projectId", "thread-1")
|
||||
.withString("projectTitle", "北区试产线回归")
|
||||
.withString("folderLabel", "Mac Studio")
|
||||
.withString("lastMessagePreview", "认证链路交接线程")
|
||||
.withString("latestReplyLabel", "09:26")
|
||||
.withInt("unreadCount", 3)
|
||||
.withInt("activityIconCount", 2);
|
||||
|
||||
WechatSurfaceMapper.ConversationRow row = GroupCreateActivity.toCandidateConversationRow(item, true);
|
||||
|
||||
assertEquals("北区试产线回归", row.threadTitle);
|
||||
assertEquals("Mac Studio", row.folderLabel);
|
||||
assertEquals("认证链路交接线程", row.lastMessagePreview);
|
||||
assertEquals("09:26", row.timeLabel);
|
||||
assertEquals("已选", row.topPinnedLabel);
|
||||
assertEquals(0, row.unreadCount);
|
||||
assertEquals(0, row.activityIconCount);
|
||||
}
|
||||
|
||||
private static Set<String> linkedSet(String... values) {
|
||||
Set<String> result = new LinkedHashSet<>();
|
||||
for (String value : values) {
|
||||
@@ -114,6 +136,11 @@ public class GroupCreateActivityTest {
|
||||
return this;
|
||||
}
|
||||
|
||||
StubJSONObject withInt(String key, int value) {
|
||||
values.put(key, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
StubJSONObject withObjectArray(String key, JSONObject... entries) {
|
||||
values.put(key, new StubJSONArray(entries));
|
||||
return this;
|
||||
@@ -131,6 +158,12 @@ public class GroupCreateActivityTest {
|
||||
return value instanceof Boolean ? (Boolean) value : defaultValue;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int optInt(String key, int defaultValue) {
|
||||
Object value = values.get(key);
|
||||
return value instanceof Integer ? (Integer) value : defaultValue;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONArray optJSONArray(String key) {
|
||||
Object value = values.get(key);
|
||||
|
||||
Reference in New Issue
Block a user