reflex/tests/components
Masen Furer 356deb5457
[REF-3589] raise EventHandlerArgMismatch when event handler args don't match spec (#3853)
* test_component: improve valid/invalid event trigger tests

Add test cases for event triggers defined as annotations.

Add additional cases around lambda returning different values.

Improve assertions for invalid tests (each line needs its own `pytest.raises`).

More invalid test cases.

* [REF-3589] raise EventHandlerArgMismatch when event handler args don't match spec

Improve error message for common issue.

Previously when the event handler arguments didn't match the spec, the
traceback resulted in:

```
OSError: could not get source code
```

Now this problem is traceable as a distinct error condition and users are
empowered to debug their code and reference the documentation (to be updated)
for further information.

* raise EventFnArgMismatch when lambda args don't match event trigger spec

Improve error message for another common issue encountered in the reflex framework.

Previous error message was

```
TypeError: index.<locals>.<lambda>() takes 0 positional arguments but 1 was given
```

* Fix up lambda test cases

* call_event_fn: adjust number of args for bound methods
2024-08-29 16:05:15 -07:00
..
base fully migrate vars into new system (#3743) 2024-08-26 13:28:18 -07:00
core fully migrate vars into new system (#3743) 2024-08-26 13:28:18 -07:00
datadisplay fully migrate vars into new system (#3743) 2024-08-26 13:28:18 -07:00
el Lendemor/improve coverage (#2988) 2024-04-04 14:31:43 +02:00
forms fully migrate vars into new system (#3743) 2024-08-26 13:28:18 -07:00
graphing Layout property not pushed through on rx.plotly (#3394) 2024-05-31 11:48:43 -07:00
layout generate pyi files when building/publishing 3rd party component (#2945) 2024-03-29 09:54:21 -07:00
lucide [REF-3568][REF-3569]Remove deprecations (#3852) 2024-08-29 15:46:18 -07:00
media fully migrate vars into new system (#3743) 2024-08-26 13:28:18 -07:00
radix add_style api (#3202) 2024-05-06 16:59:11 -07:00
typography [REF-3536][REF-3537][REF-3541] Move chakra components into its repo(reflex-chakra) (#3798) 2024-08-19 13:41:31 -07:00
__init__.py Add basic unit tests (#7) 2022-11-20 14:34:25 -08:00
test_component_future_annotations.py [REF-2272] Support declaring EventHandlers directly in component (#2952) 2024-03-29 06:26:07 -07:00
test_component_state.py fully migrate vars into new system (#3743) 2024-08-26 13:28:18 -07:00
test_component.py [REF-3589] raise EventHandlerArgMismatch when event handler args don't match spec (#3853) 2024-08-29 16:05:15 -07:00
test_tag.py fully migrate vars into new system (#3743) 2024-08-26 13:28:18 -07:00