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

CdsPaginationButton renders disabled="false" resulting in failing unit tests #151

Closed
3 of 8 tasks
ashleyryan opened this issue Aug 18, 2022 · 2 comments
Closed
3 of 8 tasks

Comments

@ashleyryan
Copy link
Contributor

ashleyryan commented Aug 18, 2022

Describe the bug

After the last release, related to PR #130, when set with disabled={false}, testing-library unit tests will fail if they have expect(pagination button).not.toBeDisabled()

How to reproduce

main...ashleyryan:core:asryan/pagination-test

Steps to reproduce the behavior:

  1. Run unit test
  2. Notice console error
Received element is disabled:
      <cds-pagination-button action="last" aria-disabled="false" aria-label="go to last" cds-button-action="" disabled="false" role="button" shape="step-forward-2" tabindex="0" />

Expected behavior

The test should pass because the button is not disabled, but it's being rendered with disabled="false". This started happening after #130 with the change of the disabled attribute in the base button from a simple property to a getter/setter. Lit has a fix for this in the latest version of @lit-labs/react

Versions

Clarity project:

  • Clarity Core
  • Clarity Angular/UI

Clarity version:

  • v5.x
  • v6.x

Framework:

  • Angular
  • React
  • Vue
  • Other:

Framework version:
ie: Angular 11

Device:

  • Type: [e.g. MacBook]
  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Additional notes

Add any other notes about the problem here.

ashleyryan pushed a commit to ashleyryan/core that referenced this issue Aug 18, 2022
Fixes  vmware-clarity#151

passing in a false value renders hidden="false" in the DOM, which is breaking the overlay layer logic

This is the boolean attribute issue that also effected modals as well
@ashleyryan ashleyryan self-assigned this Aug 23, 2022
@github-actions
Copy link

🎉 This issue has been resolved in version 6.1.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions
Copy link

Hi there 👋, this is an automated message. To help Clarity keep track of discussions, we automatically lock closed issues after 14 days. Please look for another open issue or open a new issue with updated details and reference this one as necessary.

@github-actions github-actions bot locked and limited conversation to collaborators Sep 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant