mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Rename visible property to display, add setter
This commit is contained in:
25
tests/test_dom.py
Normal file
25
tests/test_dom.py
Normal file
@@ -0,0 +1,25 @@
|
||||
import pytest
|
||||
|
||||
from textual.css.errors import StyleValueError
|
||||
from textual.dom import DOMNode
|
||||
|
||||
|
||||
def test_display_default():
|
||||
node = DOMNode()
|
||||
assert node.display is True
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"setter_value,style_value",
|
||||
[[True, "block"], [False, "none"], ["block", "block"], ["none", "none"]],
|
||||
)
|
||||
def test_display_set_bool(setter_value, style_value):
|
||||
node = DOMNode()
|
||||
node.display = setter_value
|
||||
assert node.styles.display == style_value
|
||||
|
||||
|
||||
def test_display_set_invalid_value():
|
||||
node = DOMNode()
|
||||
with pytest.raises(StyleValueError):
|
||||
node.display = "blah"
|
||||
Reference in New Issue
Block a user