-
Notifications
You must be signed in to change notification settings - Fork 0
Render example status as HTML #1
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
Conversation
| end | ||
| end | ||
|
|
||
| private |
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.
There is already a private keyword above this, so I removed this one.
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.
Caution
Changes requested ❌
Reviewed everything up to dfcdeb9 in 1 minute and 39 seconds. Click for details.
- Reviewed
121lines of code in5files - Skipped
0files when reviewing. - Skipped posting
3draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. README.md:267
- Draft comment:
New documentation forstatus_htmlis clear. Good update to include the new status section in the API reference. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
2. lib/rspec/html_messages/templates/example.html.erb:2
- Draft comment:
The inclusion of the status block viastatus_htmlis correct. Note that the extrawrapper may be redundant since the_status.html.erbpartial already outputs a containingelement. - Reason this comment was not posted:
Confidence changes required:30%<= threshold50%None
3. lib/rspec/html_messages.rb:101
- Draft comment:
Refactoring boolean checks to use the newfailed?helper (in place of 'status == "failed"') improves consistency. This change is clear and enhances maintainability. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
Workflow ID: wflow_6vxX3aTq6N4HmEcG
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
lib/rspec/html_messages.rb
Outdated
| end | ||
|
|
||
| def status_html(**options) | ||
| css_class, message = "" |
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.
Avoid the ambiguous assignment ‘css_class, message = ""’. It’s clearer to initialize variables in their respective branches or initialize them explicitly (e.g., using css_class = '' and message = '') to avoid potential confusion.
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.
Important
Looks good to me! 👍
Reviewed 6502ec6 in 1 minute and 43 seconds. Click for details.
- Reviewed
16lines of code in1files - Skipped
0files when reviewing. - Skipped posting
1draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. lib/rspec/html_messages.rb:161
- Draft comment:
The new failed? method now checks that status == "failed" instead of using !passed?. This means that if an example’s status is "pending", it will no longer be treated as failed. Ensure that this change is intentional and that pending examples are handled appropriately elsewhere. - Reason this comment was not posted:
Comment looked like it was already resolved.
Workflow ID: wflow_Hn0x9crdPcrsCywB
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
| <% end %> | ||
|
|
||
| <% if output_content = output_html(**@options) %> | ||
| <div> |
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.
I think this div may need an mt-3 now, for consistency?
raghubetina
left a comment
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.
Minor comment, LGTM
lib/rspec/html_messages.rb
Outdated
| css_class = "alert-success" | ||
| message = "This test passed!" | ||
| else | ||
| css_class = "alert-danger" |
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.
| css_class = "alert-danger" | |
| css_class = "alert-warning" |
I was thinking of yellow for failures (and avoiding the word "fail" in messages), to be less scary. I used warning below too for the failure message card bg-color.
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.
Important
Looks good to me! 👍
Reviewed ca316b2 in 1 minute and 10 seconds. Click for details.
- Reviewed
31lines of code in2files - Skipped
0files when reviewing. - Skipped posting
3draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. lib/rspec/html_messages.rb:84
- Draft comment:
Remove the redundant initialization 'css_class, message = ""' since both variables are assigned on all paths below. This improves code clarity. - Reason this comment was not posted:
Confidence changes required:33%<= threshold50%None
2. lib/rspec/html_messages.rb:89
- Draft comment:
The change from 'alert-danger' to 'alert-warning' aligns with the updated design. Consider whether tests with status 'pending' should be handled differently. - Reason this comment was not posted:
Confidence changes required:33%<= threshold50%None
3. lib/rspec/html_messages/templates/example.html.erb:9
- Draft comment:
The addition of the 'mt-3' class to the output container ensures proper spacing. For consistency, consider if a similar margin should be applied to the status block. - Reason this comment was not posted:
Confidence changes required:33%<= threshold50%None
Workflow ID: wflow_inT01b3GwufPK3h6
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
Problem
render_htmldoesn't explicitly include the status of the test example. The status is important for understanding the output at a glance.Solution
This PR adds a
status_htmlmethod that renders a styled alert with a status message.Important
Adds
status_htmlmethod to render test status as HTML alert and integrates it intorender_html, updating templates and version to 0.2.1.status_htmlmethod inhtml_messages.rbto render test status as HTML alert.status_htmlintorender_htmlto display status above other sections inexample.html.erb._status.html.erbfor rendering status alerts.example.html.erbto include status content.0.2.1inversion.rb.This description was created by
for ca316b2. You can customize this summary. It will automatically update as commits are pushed.