
* delete most references to varr * [REF-3562][REF-3563] Replace chakra usage (#3872) * only one mention of var * delete vars.py why not * remove reflex.vars * rename immutable var to var * rename ivars to vars * add vars back smh * ruff * no more create_safe * reorder deprecated * remove raises * remove all Var.create * move to new api * fix unit tests * fix pyi hopefully * sort literals * fix event handler issues * update poetry * fix silly issues i'm very silly * add var_operation_return * rename immutable to not immutable * add str type * it's ruff out there --------- Co-authored-by: Elijah Ahianyo <elijahahianyo@gmail.com>
31 lines
838 B
Python
31 lines
838 B
Python
import pytest
|
|
|
|
from reflex.components.lucide.icon import Icon
|
|
from reflex.components.radix.themes.components.icon_button import IconButton
|
|
from reflex.style import Style
|
|
from reflex.vars.base import LiteralVar
|
|
|
|
|
|
def test_icon_button():
|
|
ib1 = IconButton.create("activity")
|
|
assert isinstance(ib1, IconButton)
|
|
|
|
ib2 = IconButton.create(Icon.create("activity"))
|
|
assert isinstance(ib2, IconButton)
|
|
|
|
assert isinstance(ib1.add_style(), Style)
|
|
assert isinstance(ib2.add_style(), Style)
|
|
|
|
|
|
def test_icon_button_no_child():
|
|
with pytest.raises(ValueError):
|
|
_ = IconButton.create()
|
|
|
|
|
|
def test_icon_button_size_prop():
|
|
ib1 = IconButton.create("activity", size="2")
|
|
assert isinstance(ib1, IconButton)
|
|
|
|
ib2 = IconButton.create("activity", size=LiteralVar.create("2"))
|
|
assert isinstance(ib2, IconButton)
|