diff --git a/tests/test_panel.py b/tests/test_panel.py index c2c6e3b2..da6ad785 100644 --- a/tests/test_panel.py +++ b/tests/test_panel.py @@ -1,5 +1,6 @@ import io from rich.console import Console +from rich.measure import Measurement from rich.panel import Panel import pytest @@ -42,6 +43,14 @@ def test_console_width(): assert max_width == 16 +def test_fixed_width(): + console = Console(file=io.StringIO(), width=50, legacy_windows=False) + panel = Panel("Hello World", width=20) + min_width, max_width = panel.__rich_measure__(console, 100) + assert min_width == 20 + assert max_width == 20 + + if __name__ == "__main__": expected = [] for panel in tests: