mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Tidy up the disabled snapshot test
This commit is contained in:
@@ -1,13 +1,26 @@
|
||||
from textual.app import App, ComposeResult
|
||||
from textual.containers import Vertical
|
||||
from textual.containers import Vertical, Horizontal
|
||||
from textual.widgets import (
|
||||
Header, Footer, Button, DataTable, Input, ListView, ListItem, Label, Tree, TextLog
|
||||
Header,
|
||||
Footer,
|
||||
Button,
|
||||
DataTable,
|
||||
Input,
|
||||
ListView,
|
||||
ListItem,
|
||||
Label,
|
||||
Tree,
|
||||
TextLog,
|
||||
)
|
||||
|
||||
|
||||
class WidgetDisableTestApp(App[None]):
|
||||
|
||||
CSS = """
|
||||
DataTable, ListView, Tree {
|
||||
Horizontal {
|
||||
height: auto;
|
||||
}
|
||||
DataTable, ListView, Tree, TextLog {
|
||||
height: 2;
|
||||
}
|
||||
"""
|
||||
@@ -23,9 +36,7 @@ class WidgetDisableTestApp( App[ None ] ):
|
||||
|
||||
@property
|
||||
def list_view(self) -> ListView:
|
||||
return ListView(
|
||||
*[ ListItem( Label( f"This is list item {n}" ) ) for n in range( 20 ) ]
|
||||
)
|
||||
return ListView(*[ListItem(Label(f"This is list item {n}")) for n in range(20)])
|
||||
|
||||
@property
|
||||
def test_tree(self) -> Tree:
|
||||
@@ -38,7 +49,13 @@ class WidgetDisableTestApp( App[ None ] ):
|
||||
def compose(self) -> ComposeResult:
|
||||
yield Header()
|
||||
yield Vertical(
|
||||
Horizontal(
|
||||
Button(),
|
||||
Button(variant="primary"),
|
||||
Button(variant="success"),
|
||||
Button(variant="warning"),
|
||||
Button(variant="error"),
|
||||
),
|
||||
self.data_table,
|
||||
self.list_view,
|
||||
self.test_tree,
|
||||
@@ -54,5 +71,6 @@ class WidgetDisableTestApp( App[ None ] ):
|
||||
self.query_one(TextLog).write("Hello, World!")
|
||||
self.query_one("#test-container", Vertical).disabled = True
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
WidgetDisableTestApp().run()
|
||||
|
||||
Reference in New Issue
Block a user