non_template_nested_type_not_expanded test fix

commit_hash:5855c4dac8b5229205532bb38a74e43f13c66692
This commit is contained in:
booster
2026-04-29 12:55:13 +03:00
parent a5ebf2736e
commit a494e55b46
4 changed files with 105 additions and 147 deletions
@@ -2,6 +2,9 @@
"description": "A template name ('button') collides with the value of a 'type' field inside a non-Div nested property (accessibility.type). Verifies the resolver does not treat that non-Div dict as a template usage.",
"templates": {
"button": {
"type": "text"
},
"content": {
"type": "text",
"accessibility": {
"type": "button"
@@ -14,7 +17,7 @@
{
"state_id": 0,
"div": {
"type": "button",
"type": "content",
"text": "Click me"
}
}
@@ -1,114 +0,0 @@
{
"description": "A template usage supplies a literal field whose name matches the source of a deep (non-top-level) reference definition inside the template body. Verifies two things simultaneously: the usage's literal is preserved on the expanded middle-level dict (it is not consumed as a formal parameter value), and the deep reference still resolves against the outer card instance rather than the usage's same-named literal (the literal does not shadow the deep reference).",
"card": {
"log_id": "test",
"states": [
{
"state_id": 0,
"div": {
"background": [
{
"type": "solid",
"color": "#f00"
}
],
"type": "root"
}
}
]
},
"templates": {
"root": {
"type": "container",
"items": [
{
"type": "nested",
"background": [
{
"type": "solid",
"color": "#0f0"
}
]
}
]
},
"nested": {
"type": "container",
"items": [
{
"type": "container",
"margins": {
"top": 100,
"bottom": 100,
"left": 100,
"right": 100
},
"width": {
"type": "fixed",
"value": 100
},
"height": {
"type": "fixed",
"value": 100
},
"$background": "background"
}
]
}
},
"expected": {
"card": {
"log_id": "test",
"states": [
{
"state_id": 0,
"div": {
"type": "container",
"background": [
{
"type": "solid",
"color": "#f00"
}
],
"items": [
{
"type": "container",
"items": [
{
"type": "container",
"margins": {
"top": 100,
"bottom": 100,
"left": 100,
"right": 100
},
"width": {
"type": "fixed",
"value": 100
},
"height": {
"type": "fixed",
"value": 100
},
"background": [
{
"type": "solid",
"color": "#f00"
}
]
}
],
"background": [
{
"type": "solid",
"color": "#0f0"
}
]
}
]
}
}
]
}
}
}