mirror of
https://github.com/divkit/divkit.git
synced 2026-05-07 20:02:32 +00:00
Another link resolution fix
commit_hash:71aa042987af2b242632f1f161811b7a9bb54b33
This commit is contained in:
@@ -0,0 +1,61 @@
|
||||
{
|
||||
"description": "Link (titleTextRef) exist in the middle of template resolution chain (nested_container)",
|
||||
"templates": {
|
||||
"root_container": {
|
||||
"type": "container",
|
||||
"items": [
|
||||
{
|
||||
"type": "nested_container"
|
||||
}
|
||||
]
|
||||
},
|
||||
"nested_container": {
|
||||
"type": "container",
|
||||
"items": [
|
||||
{
|
||||
"type": "title_text",
|
||||
"$text": "titleTextRef"
|
||||
}
|
||||
]
|
||||
},
|
||||
"title_text": {
|
||||
"type": "text"
|
||||
}
|
||||
},
|
||||
"card": {
|
||||
"log_id": "test",
|
||||
"states": [
|
||||
{
|
||||
"state_id": 0,
|
||||
"div": {
|
||||
"titleTextRef": "Title Text",
|
||||
"type": "root_container"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"expected": {
|
||||
"card": {
|
||||
"log_id": "test",
|
||||
"states": [
|
||||
{
|
||||
"state_id": 0,
|
||||
"div": {
|
||||
"type": "container",
|
||||
"items": [
|
||||
{
|
||||
"type": "container",
|
||||
"items": [
|
||||
{
|
||||
"text": "Title Text",
|
||||
"type": "text"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
{
|
||||
"description": "Link (image_start) not for direct property of text, but for nested properties (images)",
|
||||
"card": {
|
||||
"log_id": "test",
|
||||
"states": [
|
||||
{
|
||||
"state_id": 0,
|
||||
"div": {
|
||||
"image_start": 5,
|
||||
"type": "root_container"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"templates": {
|
||||
"title_text": {
|
||||
"type": "text"
|
||||
},
|
||||
"root_container": {
|
||||
"type": "container",
|
||||
"items": [
|
||||
{
|
||||
"text": "Title",
|
||||
"images": [
|
||||
{
|
||||
"$start": "image_start",
|
||||
"url": "https://yastatic.net/s3/home/divkit/chess.png"
|
||||
}
|
||||
],
|
||||
"type": "title_text"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"expected": {
|
||||
"card": {
|
||||
"log_id": "test",
|
||||
"states": [
|
||||
{
|
||||
"state_id": 0,
|
||||
"div": {
|
||||
"type": "container",
|
||||
"items": [
|
||||
{
|
||||
"text": "Title",
|
||||
"images": [
|
||||
{
|
||||
"start": 5,
|
||||
"url": "https://yastatic.net/s3/home/divkit/chess.png"
|
||||
}
|
||||
],
|
||||
"type": "text"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user