Skip to content

Commit

Permalink
test: Add test for _Then as encoding condition
Browse files Browse the repository at this point in the history
  • Loading branch information
dangotbanned committed May 31, 2024
1 parent dfc14de commit 328338a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/vegalite/v5/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,16 @@ def test_when_then() -> None:
when.then(pathlib.Path("some")) # type: ignore[arg-type]


def test_when_then_only(basic_chart) -> None:
"""`_Then` is an acceptable encode argument."""
from altair.vegalite.v5 import api as _alt

select = alt.selection_point(name="select", on="click")
when_then = _alt._when(select).then(alt.value(5))

basic_chart.encode(fillOpacity=when_then).to_dict()


def test_when_then_otherwise() -> None:
from altair.vegalite.v5 import api as _alt

Expand Down

0 comments on commit 328338a

Please sign in to comment.