Files
burstein 3b5319c96a Supported dynamic variables in expressions
commit_hash:0397a4b5c9e86b49dbcde0edf3084ddba5a4b85f
2025-06-30 01:13:48 +03:00

200 lines
4.2 KiB
JSON

{
"description": "Check getStringValue subscription.",
"div_data": {
"card": {
"log_id": "get_string_value",
"variables": [
{
"name": "part_of_name",
"type": "string",
"value": "1"
},
{
"name": "var_1",
"type": "string",
"value": "var_1_initial"
},
{
"name": "var_2",
"type": "string",
"value": "var_2_initial"
}
],
"variable_triggers": [
{
"condition": "@{getStringValue('var_' + part_of_name, '') != ''}",
"mode": "on_variable",
"actions": [
{
"log_id": "check result",
"typed": {
"type": "set_variable",
"variable_name": "result",
"value": {
"type": "string",
"value": "@{getStringValue('var_' + part_of_name, '')}"
}
}
}
]
}
],
"states": [
{
"state_id": 0,
"div": {
"type": "text",
"text": "text"
}
}
]
}
},
"cases": [
{
"expected": [
{
"type": "variable",
"variable_name": "result",
"value": {
"type": "string",
"value": "var_1_initial"
}
}
],
"platforms": [
"android",
"ios",
"web"
]
},
{
"div_actions": [
{
"log_id": "change part of name",
"url": "div-action://set_variable?name=part_of_name&value=2"
}
],
"expected": [
{
"type": "variable",
"variable_name": "result",
"value": {
"type": "string",
"value": "var_2_initial"
}
}
],
"platforms": [
"android",
"ios",
"web"
]
},
{
"div_actions": [
{
"log_id": "change value",
"url": "div-action://set_variable?name=var_1&value=var_1_changed"
}
],
"expected": [
{
"type": "variable",
"variable_name": "result",
"value": {
"type": "string",
"value": "var_1_changed"
}
}
],
"platforms": [
"android",
"ios",
"web"
]
},
{
"div_actions": [
{
"log_id": "change part of name",
"url": "div-action://set_variable?name=part_of_name&value=2"
},
{
"log_id": "change value",
"url": "div-action://set_variable?name=var_2&value=var_2_changed"
}
],
"expected": [
{
"type": "variable",
"variable_name": "result",
"value": {
"type": "string",
"value": "var_2_changed"
}
}
],
"platforms": [
"android",
"ios",
"web"
]
},
{
"div_actions": [
{
"log_id": "change part of name",
"url": "div-action://set_variable?name=part_of_name&value=2"
},
{
"log_id": "change old value",
"url": "div-action://set_variable?name=var_1&value=var_1_changed"
}
],
"expected": [
{
"type": "variable",
"variable_name": "result",
"value": {
"type": "string",
"value": "var_2_initial"
}
}
],
"platforms": [
"android",
"ios",
"web"
]
},
{
"div_actions": [
{
"log_id": "change another value",
"url": "div-action://set_variable?name=var_2&value=var_2_changed"
},
{
"log_id": "change part of name",
"url": "div-action://set_variable?name=part_of_name&value=2"
}
],
"expected": [
{
"type": "variable",
"variable_name": "result",
"value": {
"type": "string",
"value": "var_2_changed"
}
}
],
"platforms": [
"android",
"ios",
"web"
]
}
]
}