refactor: remove stale import understanding surfaces

This commit is contained in:
kris
2026-04-05 07:53:03 +08:00
parent 50d5327afd
commit 28f692706b
4 changed files with 13 additions and 190 deletions

View File

@@ -37,9 +37,7 @@ public class DeviceImportDraftActivityTest {
"applyPayload",
ReflectionHelpers.ClassParameter.from(JSONObject.class, buildPendingDraft()),
ReflectionHelpers.ClassParameter.from(JSONObject.class, null),
ReflectionHelpers.ClassParameter.from(JSONObject.class, null),
ReflectionHelpers.ClassParameter.from(JSONArray.class, null),
ReflectionHelpers.ClassParameter.from(JSONArray.class, null)
ReflectionHelpers.ClassParameter.from(JSONObject.class, null)
);
View content = activity.findViewById(R.id.screen_content);
@@ -66,9 +64,7 @@ public class DeviceImportDraftActivityTest {
"applyPayload",
ReflectionHelpers.ClassParameter.from(JSONObject.class, buildAppliedDraft()),
ReflectionHelpers.ClassParameter.from(JSONObject.class, buildAppliedResolution()),
ReflectionHelpers.ClassParameter.from(JSONObject.class, null),
ReflectionHelpers.ClassParameter.from(JSONArray.class, null),
ReflectionHelpers.ClassParameter.from(JSONArray.class, null)
ReflectionHelpers.ClassParameter.from(JSONObject.class, null)
);
View content = activity.findViewById(R.id.screen_content);
@@ -80,7 +76,7 @@ public class DeviceImportDraftActivityTest {
}
@Test
public void renderCurrentStateShowsQueuedReviewTaskCopy() throws Exception {
public void renderCurrentStateShowsQueuedReviewTaskCopyWithoutProjectUnderstandingSection() throws Exception {
TestDeviceImportDraftActivity activity = Robolectric
.buildActivity(
TestDeviceImportDraftActivity.class,
@@ -96,18 +92,15 @@ public class DeviceImportDraftActivityTest {
"applyPayload",
ReflectionHelpers.ClassParameter.from(JSONObject.class, buildPendingResolutionDraft()),
ReflectionHelpers.ClassParameter.from(JSONObject.class, null),
ReflectionHelpers.ClassParameter.from(JSONObject.class, buildQueuedReviewTask()),
ReflectionHelpers.ClassParameter.from(JSONArray.class, buildUnderstandingTasks()),
ReflectionHelpers.ClassParameter.from(JSONArray.class, buildProjectUnderstandings())
ReflectionHelpers.ClassParameter.from(JSONObject.class, buildQueuedReviewTask())
);
View content = activity.findViewById(R.id.screen_content);
assertTrue(viewTreeContainsText(content, "主 Agent 审核中"));
assertTrue(viewTreeContainsText(content, "审核任务"));
assertTrue(viewTreeContainsText(content, "状态queued"));
assertTrue(viewTreeContainsText(content, "项目理解"));
assertTrue(viewTreeContainsText(content, "北区试产线回归"));
assertTrue(viewTreeContainsText(content, "树莓派二代接入与联调"));
assertFalse(viewTreeContainsText(content, "项目理解"));
assertFalse(viewTreeContainsText(content, "树莓派二代接入与联调"));
}
private static JSONObject buildPendingDraft() throws Exception {
@@ -209,27 +202,6 @@ public class DeviceImportDraftActivityTest {
.put("status", "queued");
}
private static JSONArray buildUnderstandingTasks() throws Exception {
return new JSONArray()
.put(new JSONObject()
.put("taskId", "mastertask-understanding-1")
.put("candidateId", "candidate-1")
.put("threadDisplayName", "北区试产线回归")
.put("status", "completed"));
}
private static JSONArray buildProjectUnderstandings() throws Exception {
return new JSONArray()
.put(new JSONObject()
.put("candidateId", "candidate-1")
.put("threadDisplayName", "北区试产线回归")
.put("projectGoal", "完成树莓派二代接入与联调")
.put("currentProgress", "正在核对接线和控制链路")
.put("technicalArchitecture", "Next.js 控制台 + local-agent + Codex 线程")
.put("currentBlockers", "串口稳定性待验证")
.put("recommendedNextStep", "先确认串口日志"));
}
private static boolean viewTreeContainsText(View root, String expectedText) {
if (root instanceof TextView) {
CharSequence text = ((TextView) root).getText();