Check that min_width and min_height are respected.
()
| 167 | |
| 168 | |
| 169 | async def test_min(): |
| 170 | """Check that min_width and min_height are respected.""" |
| 171 | |
| 172 | one = Fraction(1) |
| 173 | |
| 174 | class TestWidget(Widget): |
| 175 | def get_content_width(self, container: Size, parent: Size) -> int: |
| 176 | assert False, "must not be called" |
| 177 | |
| 178 | def get_content_height(self, container: Size, parent: Size, width: int) -> int: |
| 179 | assert False, "must not be called" |
| 180 | |
| 181 | widget = TestWidget() |
| 182 | styles = widget.styles |
| 183 | styles.width = 10 |
| 184 | styles.height = 5 |
| 185 | styles.min_width = 40 |
| 186 | styles.min_height = 30 |
| 187 | |
| 188 | box_model = widget._get_box_model(Size(40, 30), Size(80, 24), one, one) |
| 189 | assert box_model == BoxModel(Fraction(40), Fraction(30), Spacing(0, 0, 0, 0)) |
nothing calls this directly
no test coverage detected
searching dependent graphs…