Fix for #806 (if results table order changed, hide/show details hover over broken)#807
Merged
BeyondEvil merged 3 commits intopytest-dev:masterfrom Apr 24, 2024
Merged
Conversation
BeyondEvil
requested changes
Apr 9, 2024
Contributor
BeyondEvil
left a comment
There was a problem hiding this comment.
It be great if you could add a test for this as well, preferably an integration test.
src/pytest_html/scripts/dom.js
Outdated
|
|
||
| if (collapsed) { | ||
| resultBody.querySelector('.collapsible > td')?.classList.add('collapsed') | ||
| resultBody.querySelector('.collapsible > col-result')?.classList.add('collapsed') |
Contributor
There was a problem hiding this comment.
I don't have the code infront of my right now as I'm on vacation, but are we sure this will uniquely identify the column?
I ask because IIRC other things can have at least the ".collapsible" class.
Contributor
Author
There was a problem hiding this comment.
I believe it is but better if you can double check when you return from vacation.
Thanks.
Contributor
|
Thank you for your contribution! Please see my comments. |
Contributor
Author
|
I have added a test to verify if it adds the 'collapsed' class to col-result even if the table order changed. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
If you move 'col-result' to right hand side in results-table, it always shows 'hide details' even details are already collapsed.
the reason is, col-result is not the first td element of the results-table anymore and therefore it adds collapsible class to first td element.
because of this reason, below function does not work:
changing '.collapsible > td' to '.collapsible > col-result' fix this problem.