Skip to content

Commit 6be7895

Browse files
committed
Check some more widget state
1 parent 66d15d2 commit 6be7895

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tests/snapshot_tests/test_snapshots.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import pytest
44

55
from textual.app import App
6-
from textual.widgets import Input
6+
from textual.widgets import Input, Button
77

88

99
# --- Layout related stuff ---
@@ -69,12 +69,17 @@ def test_input_and_focus(snap_compare):
6969
input: Input = app.query_one(Input)
7070
assert input.value == "Darren"
7171
assert input.cursor_position == 6
72+
assert input.view_position == 0
7273

7374

7475
def test_buttons_render(snap_compare):
7576
# Testing button rendering. We press tab to focus the first button too.
7677
assert snap_compare("docs/examples/widgets/button.py", press=["tab"])
7778

79+
app = snap_compare.app
80+
button: Button = app.query_one(Button)
81+
assert app.focused is button
82+
7883

7984
def test_datatable_render(snap_compare):
8085
press = ["tab", "down", "down", "right", "up", "left"]

0 commit comments

Comments
 (0)