Skip to content

Commit

Permalink
Snapshot test for dock: none
Browse files Browse the repository at this point in the history
  • Loading branch information
darrenburns committed Sep 11, 2024
1 parent f5b6b6b commit 670ecff
Show file tree
Hide file tree
Showing 2 changed files with 99 additions and 1 deletion.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 20 additions & 1 deletion tests/snapshot_tests/test_snapshots.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from textual.containers import Vertical
from textual.pilot import Pilot
from textual.screen import Screen
from textual.widgets import Button, Input, RichLog, TextArea, Footer
from textual.widgets import Button, Header, Input, RichLog, TextArea, Footer
from textual.widgets import Switch
from textual.widgets import Label
from textual.widgets.text_area import BUILTIN_LANGUAGES, Selection, TextAreaTheme
Expand Down Expand Up @@ -738,6 +738,25 @@ def test_dock_scroll_off_by_one(snap_compare):
)


def test_dock_none(snap_compare):
"""Checking that `dock:none` works in CSS and Python.
The label should appear at the top here, since we've undocked both
the header and footer.
"""

class DockNone(App[None]):
CSS = "Header { dock: none; }"

def compose(self) -> ComposeResult:
yield Label("Hello")
yield Header()
footer = Footer()
footer.styles.dock = "none"
yield footer

assert snap_compare(DockNone(), terminal_size=(30, 5))


def test_scroll_to(snap_compare):
# https://github.com/Textualize/textual/issues/2525
assert snap_compare(
Expand Down

0 comments on commit 670ecff

Please sign in to comment.