Skip to content
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

Add better Paragraph/Text/Line/Span style tests #1015

Open
4 tasks
joshka opened this issue Apr 1, 2024 · 3 comments
Open
4 tasks

Add better Paragraph/Text/Line/Span style tests #1015

joshka opened this issue Apr 1, 2024 · 3 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@joshka
Copy link
Member

joshka commented Apr 1, 2024

Problem

The addition of Text::style and Line::style broke some assumptions about how things should work in Paragraph.

We need a comprehensive set of tests that shows how the following styles interact:

  • Any existing background style that is rendered to the buffer beforehand
  • Paragraph::style
  • Block::style
  • Text::style
  • Line::style
  • Span::style

Solution

  • Add an integration test for this under the tests/ folder that tests the combinations. A good name for this might be tests/text_style.rs?
  • Check whether the unit tests cover this from the perspective of the individual types and make the tests consistent and simple. A good way to do this would be to have a style module in the tests module in each of the paragraph.rs/text.rs/... files.
  • Ensure the API docs for each of the items indicate the expected interactions neatly (e.g. <this style> overrides <that style>)
  • Ensure that any illogical overrides / bugs are fixed (note that these might be bugs in the docs or bugs in the implementation. It's important to discuss and capture the rationale / intent behind these before fixing the inconsistencies.

Alternatives

Additional context

@joshka joshka added enhancement New feature or request good first issue Good for newcomers labels Apr 1, 2024
@joshka joshka changed the title Add better text style tests Add better Paragraph/Text/Line/Span style tests Apr 1, 2024
@akshay1992kalbhor
Copy link

Can I take this one?

@joshka
Copy link
Member Author

joshka commented Apr 5, 2024

Can I take this one?

Sure!

@joshka
Copy link
Member Author

joshka commented Apr 6, 2024

I added some detail to the solution suggestions. I want to re-iterate that the primary goals on this issue are to ensure that we are rendering these things consistently and correctly and to make that clear with both docs and tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants