-
Notifications
You must be signed in to change notification settings - Fork 308
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
Button disabled #1876
Button disabled #1876
Conversation
🦋 Changeset detectedLatest commit: f1e959c The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@@ -25,6 +25,20 @@ describe('Button test suite', () => { | |||
expect(link.classList).toContain('amplify-button--link'); | |||
}); | |||
|
|||
it('should add the disabled class with the disabled attribute', async () => { | |||
render( | |||
<div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: <div>
seems redundant for a single button
|
||
const disabled = await screen.findByTestId('disabled'); | ||
|
||
expect(disabled.classList).toContain('amplify-button--disabled'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
expect(disabled.classList).toContain('amplify-button--disabled'); | |
expect(disabled).toHaveClass('amplify-button--disabled'); |
@@ -25,6 +25,18 @@ describe('Button test suite', () => { | |||
expect(link.classList).toContain('amplify-button--link'); | |||
}); | |||
|
|||
it('should add the disabled class with the disabled attribute', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add a test that FieldGroupIconButton
works correctly now?
Description of changes
This PR is to add the disabled class to Button primitives when the disabled attribute is present
Description of how you validated changes
Validated on docs site with the pagination primitive which uses an
as={Button}
that strips out theisDisabled
propertyChecklist
yarn test
passessideEffects
field updatedBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.