vmware-clarity / core

Clarity is a scalable, accessible, customizable, open-source design system built with web components. Works with any JavaScript framework, created for enterprises, and designed to be inclusive.
https://clarity.design
MIT License
163 stars 42 forks source link

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

Closed ashleyryan closed 2 years ago

ashleyryan commented 2 years ago

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

https://github.com/vmware-clarity/core/compare/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 version:

Framework:

Framework version: ie: Angular 11

Device:

Additional notes

Add any other notes about the problem here.

github-actions[bot] commented 2 years ago

:tada: This issue has been resolved in version 6.1.2 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

github-actions[bot] commented 2 years ago

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.