Files
divkit/test_data/integration_test_data/local_functions_array.json
T
4eb0da 64e3a75e12 Integration tests
commit_hash:951943346e70aea6a4cc69b5a69e9f466a314812
2025-03-27 20:21:35 +03:00

81 lines
1.7 KiB
JSON

{
"description": "Local functions with array arguments.",
"div_data": {
"card": {
"log_id": "local_functions",
"variables": [
{
"name": "array_var",
"type": "array",
"value": [
123,
123.45
]
},
{
"name": "step",
"type": "integer",
"value": -1
}
],
"states": [
{
"state_id": 0,
"div": {
"type": "text",
"text": "text",
"functions": [
{
"name": "getArrayLengthFunction",
"body": "@{len(array)}",
"return_type": "integer",
"arguments": [
{
"name": "array",
"type": "array"
}
]
}
],
"variable_triggers": [
{
"condition": "@{step == 0}",
"actions": [
{
"log_id": "step 0",
"url": "div-action://set_variable?name=result&value=@{getArrayLengthFunction(array_var)}"
}
]
}
]
}
}
]
}
},
"cases": [
{
"div_actions": [
{
"log_id": "check getArrayLengthFunction",
"url": "div-action://set_variable?name=step&value=0"
}
],
"expected": [
{
"type": "variable",
"variable_name": "result",
"value": {
"type": "integer",
"value": 2
}
}
],
"platforms": [
"android",
"web"
]
}
]
}