Skip to content

Commit

Permalink
added test for disabled selected elements
Browse files Browse the repository at this point in the history
  • Loading branch information
tmbo committed Dec 25, 2021
1 parent e8cb192 commit 23d5f8a
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/prompts/test_checkbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,19 @@ def test_select_first_choice_with_token_title():
assert result == ["foo"]


def test_select_disabled_choices_if_they_are_default():
message = "Foo message"
kwargs = {"choices": [
Choice("foo", checked=True),
Choice("bar", disabled="unavailable", checked=True),
Choice("baz", disabled="unavailable"),
]}
text = KeyInputs.ENTER + "\r"

result, cli = feed_cli_with_input("checkbox", message, text, **kwargs)
assert result == ["foo", "bar"]


def test_select_and_deselct():
message = "Foo message"
kwargs = {"choices": ["foo", "bar", "bazz"]}
Expand Down

0 comments on commit 23d5f8a

Please sign in to comment.