-
Notifications
You must be signed in to change notification settings - Fork 235
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 for #806 (if results table order changed, hide/show details hover over broken) #807
Conversation
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.
It be great if you could add a test for this as well, preferably an integration test.
src/pytest_html/scripts/dom.js
Outdated
@@ -57,10 +57,10 @@ const dom = { | |||
} | |||
|
|||
if (collapsed) { | |||
resultBody.querySelector('.collapsible > td')?.classList.add('collapsed') | |||
resultBody.querySelector('.collapsible > col-result')?.classList.add('collapsed') |
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 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.
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 believe it is but better if you can double check when you return from vacation.
Thanks.
Thank you for your contribution! Please see my comments. |
I have added a test to verify if it adds the 'collapsed' class to col-result even if the table order changed. |
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.
LGTM!
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.