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: Makes button dropdown main action clickable with Enter #2897

Merged
merged 1 commit into from
Oct 18, 2024

Conversation

pan-kot
Copy link
Member

@pan-kot pan-kot commented Oct 18, 2024

Description

When a button dropdown is rendered with main action only (for test utils consistency) the main action wasn't clickable with enter. The PR fixes that.

Rel: [baiAA7LWUcov]

How has this been tested?

  • New integration test
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.

Copy link

codecov bot commented Oct 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.20%. Comparing base (7693793) to head (dc8d6b8).
Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2897      +/-   ##
==========================================
- Coverage   96.21%   96.20%   -0.01%     
==========================================
  Files         761      761              
  Lines       21490    21490              
  Branches     7359     7349      -10     
==========================================
- Hits        20676    20675       -1     
- Misses        761      762       +1     
  Partials       53       53              

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

@@ -76,4 +78,21 @@ describe('clicking on a ButtonDropdown item', () => {
await expect(page.getLocation()).resolves.toEqual(oldLocation);
})
);
test(
Copy link
Member

Choose a reason for hiding this comment

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

Since this feature is meant for an internal usage of property filter only, I would be more inclined to test this as part of property filter functionality, rather than making a case for a standalone button dropdown with only main action which in reality we don't expose as a user experience —it is an implementation detail. But this is not a blocker

Copy link
Member Author

Choose a reason for hiding this comment

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

I'd rather keep it here as the internal API of the component still belongs to it, I think - that is because from the property filter perspective I'd expect that behaviour to just work. If there was a test verifying the "Add filter" button can be clicked with Enter - that test would require a comment to state why is it needed as otherwise we might refactor it to use click interaction instead as it is simpler to code. It is also more challenging to setup an integ test for the property filter and in unit test the button click is not triggering if casting Enter keypress.

@pan-kot pan-kot added this pull request to the merge queue Oct 18, 2024
Merged via the queue into main with commit e97273e Oct 18, 2024
38 checks passed
@pan-kot pan-kot deleted the fix-button-dropdown-with-main-action-only branch October 18, 2024 11:31
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.

3 participants