-
Notifications
You must be signed in to change notification settings - Fork 826
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix border issue #2074
Merged
Merged
fix border issue #2074
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
356 changes: 176 additions & 180 deletions
356
tests/snapshot_tests/__snapshots__/test_snapshots.ambr
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,40 @@ | ||
from textual.app import App, ComposeResult | ||
from textual.containers import Grid | ||
from textual.widget import Widget | ||
from textual.containers import Vertical | ||
from textual.widgets import Label | ||
|
||
class BorderAlphaApp(App[None]): | ||
|
||
CSS = """ | ||
Grid { | ||
height: 100%; | ||
class BorderAlphaApp(App[None]): | ||
CSS = """ | ||
.boxes { | ||
height: 3; | ||
width: 100%; | ||
grid-size: 2 2; | ||
} | ||
|
||
#b00 { border: 0%; } | ||
#b01 { border: 33%; } | ||
#b02 { border: 66%; } | ||
#b03 { border: 100%; } | ||
|
||
#b10 { border: solid 0%; } | ||
#b11 { border: dashed 33%; } | ||
#b12 { border: round 66%; } | ||
#b13 { border: ascii 100%; } | ||
|
||
#b20 { border: 0% red; } | ||
#b21 { border: 33% orange; } | ||
#b22 { border: 66% green; } | ||
#b23 { border: 100% blue; } | ||
|
||
#b30 { border: solid 0% red; } | ||
#b31 { border: dashed 33% orange; } | ||
#b32 { border: round 66% green; } | ||
#b33 { border: ascii 100% blue; } | ||
|
||
#box0 { | ||
border: heavy green 0%; | ||
} | ||
#box1 { | ||
border: heavy green 20%; | ||
} | ||
#box2 { | ||
border: heavy green 40%; | ||
} | ||
#box3 { | ||
border: heavy green 60%; | ||
} | ||
#box4 { | ||
border: heavy green 80%; | ||
} | ||
#box5 { | ||
border: heavy green 100%; | ||
} | ||
""" | ||
|
||
def compose( self ) -> ComposeResult: | ||
with Grid(): | ||
for outer in range(4): | ||
with Grid(): | ||
for inner in range(4): | ||
yield Widget(id=f"b{outer}{inner}") | ||
def compose(self) -> ComposeResult: | ||
with Vertical(): | ||
for box in range(6): | ||
yield Label(id=f"box{box}", classes="boxes") | ||
|
||
|
||
if __name__ == "__main__": | ||
BorderAlphaApp().run() |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rewrote this snapshot test, because it wasn't clear to me what it should look like.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem I see with the rewrite is that it doesn't exercise the CSS parser in quite the same way. The original test was designed to try out a good combination of styles, colours and alpha values to ensure it all worked together.
That looks to have been lost.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True. But those are better captured with a unit test. Snapshots should be used to validate that things look correct only, where you can't tell from the data alone.