test(design): 端到端·composer 透传 reference 列→编译显名 <COL>_DISPLAY__
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -77,4 +77,24 @@ class RecipePageComposerTest {
|
||||
// displayField 回退到 NAME,filter 兜底用它(此处只需 compose 成功不抛)。
|
||||
assertEquals("page", page.path("type").asText());
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisplayName("4. 端到端: compose 含 reference 列的页 → list 列 name 显名 <COL>_DISPLAY__")
|
||||
void composeRendersReferenceDisplayEndToEnd() {
|
||||
RecipePageComposer.Spec spec = new RecipePageComposer.Spec(
|
||||
"EIP4AI_ORDER", "订单", PageBlueprint.RECIPE_MAINTENANCE_CRUD,
|
||||
"订单维护", "ORDERNO", 20,
|
||||
List.of(
|
||||
new RecipePageComposer.AttrSpec("ORDERNO", "订单号", "string", true, null, null),
|
||||
// 引用列:referenceTable 非空 + type=reference(端点层从 EntityAttribute 透传而来)
|
||||
new RecipePageComposer.AttrSpec("CUSTOMERID", "客户", "reference", false,
|
||||
"EIP4AI_CUSTOMER", "NAME")));
|
||||
|
||||
ObjectNode page = composer.compose(spec);
|
||||
ArrayNode columns = (ArrayNode) page.path("body").path("columns");
|
||||
|
||||
assertEquals("ORDERNO", columns.get(0).path("name").asText());
|
||||
assertEquals("CUSTOMERID_DISPLAY__", columns.get(1).path("name").asText());
|
||||
assertEquals("客户", columns.get(1).path("label").asText());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user