Skip to content

Commit

Permalink
Fix tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigogiraoserrao committed Jan 15, 2024
1 parent 19462ad commit 044fbdb
Show file tree
Hide file tree
Showing 12 changed files with 1,139 additions and 1,137 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- `SelectionList` option IDs are usable as soon as the widget is instantiated https://github.com/Textualize/textual/issues/3903
- Fix issue with `Strip.crop` when crop window start aligned with strip end https://github.com/Textualize/textual/pull/3998
- Fixed Strip.crop_extend https://github.com/Textualize/textual/pull/4011
- `width`, `max-width`, `min-width`, `height`, `max-height`, and `min-height`, calculations were off for certain combinations of padding, margin, and units https://github.com/Textualize/textual/issues/3721


## [0.47.1] - 2023-01-05
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/styles/border.tcss
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Screen {
}

Screen > Label {
width: 100%;
width: 1fr;
height: 5;
content-align: center middle;
color: white;
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/styles/border_subtitle_align.tcss
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
}

Screen > Label {
width: 100%;
width: 1fr;
height: 5;
content-align: center middle;
color: white;
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/styles/border_title_align.tcss
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
}

Screen > Label {
width: 100%;
width: 1fr;
height: 5;
content-align: center middle;
color: white;
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/styles/margin.tcss
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ Label {
margin: 4 8;
background: blue 20%;
border: blue wide;
width: 100%;
width: 1fr;
}
8 changes: 4 additions & 4 deletions docs/examples/styles/margin_all.tcss
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ Grid {
}

Placeholder {
width: 100%;
height: 100%;
width: 1fr;
height: 1fr;
}

Container {
width: 100%;
height: 100%;
width: 1fr;
height: 1fr;
}

.bordered {
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/styles/outline.tcss
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ Label {
margin: 4 8;
background: green 20%;
outline: wide green;
width: 100%;
width: 1fr;
}
2 changes: 1 addition & 1 deletion docs/examples/widgets/sparkline.tcss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Sparkline {
width: 100%;
width: 1fr;
margin: 2;
}
2 changes: 1 addition & 1 deletion docs/examples/widgets/sparkline_colors.tcss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Sparkline {
width: 100%;
width: 1fr;
margin: 1;
}

Expand Down
2,246 changes: 1,123 additions & 1,123 deletions tests/snapshot_tests/__snapshots__/test_snapshots.ambr

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion tests/snapshot_tests/snapshot_apps/input_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class InputApp(App):
}
Input {
margin: 1 2;
width: 1fr;
}
"""

Expand All @@ -41,5 +42,5 @@ def compose(self) -> ComposeResult:

app = InputApp()

if __name__ == '__main__':
if __name__ == "__main__":
app.run()
4 changes: 2 additions & 2 deletions tests/test_box_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def get_content_height(self, container: Size, parent: Size, width: int) -> int:
styles.width = "100%"

box_model = widget._get_box_model(Size(60, 20), Size(80, 24), one, one)
assert box_model == BoxModel(Fraction(54), Fraction(16), Spacing(1, 2, 3, 4))
assert box_model == BoxModel(Fraction(60), Fraction(16), Spacing(1, 2, 3, 4))

styles.width = "100vw"
styles.max_width = "50%"
Expand Down Expand Up @@ -127,7 +127,7 @@ def get_content_height(self, container: Size, parent: Size, width: int) -> int:
styles.height = "100%"

box_model = widget._get_box_model(Size(60, 20), Size(80, 24), one, one)
assert box_model == BoxModel(Fraction(54), Fraction(16), Spacing(1, 2, 3, 4))
assert box_model == BoxModel(Fraction(54), Fraction(20), Spacing(1, 2, 3, 4))

styles.height = "auto"
styles.margin = 2
Expand Down

0 comments on commit 044fbdb

Please sign in to comment.