Skip to content

Commit

Permalink
Merge pull request #3038 from davep/kickstart-select-tests
Browse files Browse the repository at this point in the history
Add a test for Select.value being set from the constructor
  • Loading branch information
davep authored Aug 9, 2023
2 parents 3fa6f7b + 91c3b4a commit 385f919
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/select/test_initial_value.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"""Initially https://github.com/Textualize/textual/discussions/3037"""

from textual.app import App, ComposeResult
from textual.widgets import Select


class SelectApp(App[None]):
INITIAL_VALUE = 3

def compose(self) -> ComposeResult:
yield Select[int]([(str(n), n) for n in range(10)], value=self.INITIAL_VALUE)


async def test_select_initial_value():
async with SelectApp().run_test() as pilot:
assert pilot.app.query_one(Select).value == SelectApp.INITIAL_VALUE

0 comments on commit 385f919

Please sign in to comment.