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

chore: Attaches tooltip classes to popover container #3219

Merged
merged 1 commit into from
Jan 27, 2025

Conversation

pan-kot
Copy link
Member

@pan-kot pan-kot commented Jan 26, 2025

Description

The tooltip test classes were attached to the div that contains a popover container. However, when the container becomes hidden due to scroll logic, the outer div stays and gives a false positive when checked with isDisplayed if using webdriverio v9. In the PR the classes are moved to the popover container so that the tests produce expected results.

How has this been tested?

See a failed dry-run: https://github.com/cloudscape-design/browser-test-tools/actions/runs/12945599198/job/36179765443?pr=109

The tests succeed with the fix applied: #3218

Review checklist

The following items are to be evaluated by the author(s) and the reviewer(s).

Correctness

  • Changes include appropriate documentation updates.
  • Changes are backward-compatible if not indicated, see CONTRIBUTING.md.
  • Changes do not include unsupported browser features, see CONTRIBUTING.md.
  • Changes were manually tested for accessibility, see accessibility guidelines.

Security

Testing

  • Changes are covered with new/existing unit tests?
  • Changes are covered with new/existing integration tests?

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@pan-kot pan-kot requested a review from a team as a code owner January 26, 2025 12:27
@pan-kot pan-kot requested review from just-boris and removed request for a team January 26, 2025 12:27
Copy link

codecov bot commented Jan 26, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.44%. Comparing base (372abbd) to head (fd9f283).
Report is 9 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3219      +/-   ##
==========================================
+ Coverage   96.42%   96.44%   +0.01%     
==========================================
  Files         787      790       +3     
  Lines       22191    22246      +55     
  Branches     7555     7229     -326     
==========================================
+ Hits        21398    21455      +57     
- Misses        741      784      +43     
+ Partials       52        7      -45     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -39,7 +38,7 @@ export default function Tooltip({

return (
<Portal>
<div className={clsx(styles.root, className)} {...contentAttributes} data-testid={trackKey}>
<div className={styles.root} {...contentAttributes} data-testid={trackKey}>
Copy link
Member

@just-boris just-boris Jan 27, 2025

Choose a reason for hiding this comment

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

Why is styles.root staying here? it is also a test-util only style, what is the use-case of selecting it, if it is incorrectly placed in the DOM?

Why does this DOM node needed in the first place?


There is an avatar test util pointing on this DOM node too: https://github.com/cloudscape-design/chat-components/blob/81f675f568a82891661839f382262b80ea276289/src/test-utils/dom/avatar/index.ts#L14

Do you plan updating it in a separate PR?

Copy link
Member Author

Choose a reason for hiding this comment

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

That's a good call out. I will create follow-up PRs that will 1) Remove the dependency on the tooltip wrapper from Avatar and 2) Remove the root style from this node.

I will also check if there is an opportunity to remove the node altogether. I think the "contentAttributes" and the testid can be passed down to the internal container.

@pan-kot pan-kot added this pull request to the merge queue Jan 27, 2025
Merged via the queue into main with commit 5daebff Jan 27, 2025
40 checks passed
@pan-kot pan-kot deleted the fix-tooltip-test-classes branch January 27, 2025 14:05
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.

2 participants