Files
divkit/test_data/integration_test_data/wrap_content_constraints_warning.json
T
4eb0da cdf89a9d30 Incorrect constraints error
commit_hash:5131a60b1d79784f9cdcd0d03379796d4a2ab5dc
2025-09-18 11:54:28 +03:00

153 lines
4.1 KiB
JSON

{
"description": "Warning about incorrect size constraints.",
"div_data": {
"templates": {
"test_container": {
"type": "container",
"width": {
"type": "fixed",
"value": 360
},
"orientation": "overlap",
"border": {
"stroke": {
"color": "#000000"
}
},
"margins": {
"bottom": 10
}
},
"item": {
"type": "container",
"border": {
"stroke": {
"color": "#FF0000",
"width": 3
}
},
"items": [
{
"type": "text",
"width": {
"type": "fixed",
"$value": "content_width"
},
"height": {
"type": "fixed",
"$value": "content_height"
},
"paddings": {
"start": 8,
"top": 8,
"end": 8,
"bottom": 8
},
"font_size": 16,
"$text": "title"
}
]
}
},
"card": {
"log_id": "test",
"states": [
{
"state_id": 0,
"div": {
"type": "container",
"orientation": "vertical",
"items": [
{
"type": "test_container",
"items": [
{
"type": "item",
"id": "width_item",
"width": {
"type": "wrap_content",
"min_size": {
"value": 400
},
"max_size": {
"value": 200
}
},
"content_width": 300,
"content_height": 100,
"title": "container width = 360\nitem width = wrap_content\nitem content width = 300\nmin width = 400, max width = 200"
}
]
},
{
"type": "test_container",
"height": {
"type": "fixed",
"value": 110
},
"items": [
{
"type": "item",
"id": "height_item",
"height": {
"type": "wrap_content",
"min_size": {
"value": 120
},
"max_size": {
"value": 90
}
},
"content_width": 300,
"content_height": 100,
"title": "container height = 110\nitem height = wrap_content\nitem content height = 100\nmin height = 120, max height = 90"
}
]
}
]
}
}
]
}
},
"cases": [
{
"expected": [
{
"type": "error",
"value": "Element has incorrect width constraints (min size is bigger than max size). Id: 'width_item', minSize: 400dp, maxSize: 200dp."
},
{
"type": "error",
"value": "Element has incorrect height constraints (min size is bigger than max size). Id: 'height_item', minSize: 120dp, maxSize: 90dp."
}
],
"platforms": [
"android"
],
"unsupported_platforms": {
"web": "Web error contains an object with the error properties"
}
},
{
"expected": [
{
"type": "error",
"value": "Element has incorrect width constraints (min size is bigger than max size)."
},
{
"type": "error",
"value": "Element has incorrect height constraints (min size is bigger than max size)."
}
],
"platforms": [
"web"
],
"unsupported_platforms": {
"android": "Web error contains an object with the error properties",
"ios": "Web error contains an object with the error properties"
}
}
]
}