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

Fix for #806 (if results table order changed, hide/show details hover over broken) #807

Merged
merged 3 commits into from
Apr 24, 2024

Conversation

volkan-aslan
Copy link
Contributor

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:

.col-result:hover::after {
  content: " (hide details)";
}

.col-result.collapsed:hover::after {
  content: " (show details)";
}

changing '.collapsible > td' to '.collapsible > col-result' fix this problem.

Copy link
Contributor

@BeyondEvil BeyondEvil left a 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.

@@ -57,10 +57,10 @@ const dom = {
}

if (collapsed) {
resultBody.querySelector('.collapsible > td')?.classList.add('collapsed')
resultBody.querySelector('.collapsible > col-result')?.classList.add('collapsed')
Copy link
Contributor

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.

Copy link
Contributor Author

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.

@BeyondEvil
Copy link
Contributor

Thank you for your contribution!

Please see my comments.

@volkan-aslan
Copy link
Contributor Author

I have added a test to verify if it adds the 'collapsed' class to col-result even if the table order changed.

Copy link
Contributor

@BeyondEvil BeyondEvil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@BeyondEvil BeyondEvil merged commit 38b8a6c into pytest-dev:master Apr 24, 2024
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants