reflex/tests/integration
Masen Furer a66e0f2e11
[ENG-3870] rx.call_script with f-string var produces incorrect code (#4039)
* Add additional test cases for rx.call_script

Include internal vars inside an f-string to be properly rendered on the backend
and frontend.

* [ENG-3870] rx.call_script with f-string var produces incorrect code

Avoid casting javascript code with embedded Var as LiteralStringVar

There are two cases that need to be handled:

1. The javascript code contains Vars with VarData, these can only be evaluated
   in the component context, since they may use hooks. Vars with VarData cannot be
   used from the backend. In this case, we cast the given code as a raw js
   expression and include the extracted VarData.

2. The javascript code has no VarData. In this case, we pass the code as the
   raw js expression and cast to a python str to get a js literal string to eval.

* use VarData.__bool__ instead of `is None`
2024-10-03 14:18:53 -07:00
..
init-test reorganize all tests in a single top folder (#3981) 2024-09-26 01:22:52 +02:00
shared reorganize all tests in a single top folder (#3981) 2024-09-26 01:22:52 +02:00
__init__.py reorganize all tests in a single top folder (#3981) 2024-09-26 01:22:52 +02:00
conftest.py reorganize all tests in a single top folder (#3981) 2024-09-26 01:22:52 +02:00
test_background_task.py reorganize all tests in a single top folder (#3981) 2024-09-26 01:22:52 +02:00
test_call_script.py [ENG-3870] rx.call_script with f-string var produces incorrect code (#4039) 2024-10-03 14:18:53 -07:00
test_client_storage.py reorganize all tests in a single top folder (#3981) 2024-09-26 01:22:52 +02:00
test_component_state.py reorganize all tests in a single top folder (#3981) 2024-09-26 01:22:52 +02:00
test_computed_vars.py reorganize all tests in a single top folder (#3981) 2024-09-26 01:22:52 +02:00
test_connection_banner.py reorganize all tests in a single top folder (#3981) 2024-09-26 01:22:52 +02:00
test_deploy_url.py reorganize all tests in a single top folder (#3981) 2024-09-26 01:22:52 +02:00
test_dynamic_components.py add of_type to _evaluate (#4051) 2024-10-03 13:01:19 -07:00
test_dynamic_routes.py reorganize all tests in a single top folder (#3981) 2024-09-26 01:22:52 +02:00
test_event_actions.py reorganize all tests in a single top folder (#3981) 2024-09-26 01:22:52 +02:00
test_event_chain.py reorganize all tests in a single top folder (#3981) 2024-09-26 01:22:52 +02:00
test_exception_handlers.py reorganize all tests in a single top folder (#3981) 2024-09-26 01:22:52 +02:00
test_form_submit.py reorganize all tests in a single top folder (#3981) 2024-09-26 01:22:52 +02:00
test_input.py reorganize all tests in a single top folder (#3981) 2024-09-26 01:22:52 +02:00
test_large_state.py reorganize all tests in a single top folder (#3981) 2024-09-26 01:22:52 +02:00
test_lifespan.py reorganize all tests in a single top folder (#3981) 2024-09-26 01:22:52 +02:00
test_login_flow.py reorganize all tests in a single top folder (#3981) 2024-09-26 01:22:52 +02:00
test_media.py reorganize all tests in a single top folder (#3981) 2024-09-26 01:22:52 +02:00
test_navigation.py reorganize all tests in a single top folder (#3981) 2024-09-26 01:22:52 +02:00
test_server_side_event.py reorganize all tests in a single top folder (#3981) 2024-09-26 01:22:52 +02:00
test_shared_state.py reorganize all tests in a single top folder (#3981) 2024-09-26 01:22:52 +02:00
test_state_inheritance.py reorganize all tests in a single top folder (#3981) 2024-09-26 01:22:52 +02:00
test_table.py reorganize all tests in a single top folder (#3981) 2024-09-26 01:22:52 +02:00
test_tailwind.py reorganize all tests in a single top folder (#3981) 2024-09-26 01:22:52 +02:00
test_upload.py reorganize all tests in a single top folder (#3981) 2024-09-26 01:22:52 +02:00
test_urls.py use pathlib as much as possible (#3967) 2024-10-03 17:50:39 +02:00
test_var_operations.py remove format_state and override behavior for bare (#3979) 2024-09-26 16:00:28 -07:00
utils.py reorganize all tests in a single top folder (#3981) 2024-09-26 01:22:52 +02:00