-
Notifications
You must be signed in to change notification settings - Fork 301
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ui & ui-react): Resolves ratings height discrepancy in edge case (#…
…5321) * Adjusts RatingIcon component * Adjusts display for amplify-rating class * adds test case for additional class * extends the RatingIconProps to include the BaseComponentProps * Adds changeset * Adds more context into changeset summary * fixed ordering of imports to match standards * remove unneccessary asyc * removed BaseComponentProps inheritance * cleaned up test
- Loading branch information
1 parent
31b9f29
commit 0483dd8
Showing
4 changed files
with
39 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
'@aws-amplify/ui-react': patch | ||
'@aws-amplify/ui': patch | ||
--- | ||
|
||
This change removes an inconsistency in the heights of ratings between 0-1 (non-inclusive). This change was made per customer request via a raised issue. A customer would only need to update their code if they display ratings between 0-1 (non-inclusive). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
packages/react/src/primitives/Rating/__tests__/RatingIcon.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import * as React from 'react'; | ||
import { render } from '@testing-library/react'; | ||
|
||
import { ComponentClassName } from '@aws-amplify/ui'; | ||
import { RatingIcon } from '../RatingIcon'; | ||
|
||
const CustomIcon = ({ className }: { className: string }) => ( | ||
<svg className={className}></svg> | ||
); | ||
|
||
describe('RatingIcon', () => { | ||
it('should render rating icon class', () => { | ||
const { container } = render( | ||
<RatingIcon | ||
className="test-class" | ||
icon={<CustomIcon className="dummy-icon" />} | ||
/> | ||
); | ||
|
||
const iconSpan = container.getElementsByClassName( | ||
'test-class' | ||
)[0] as HTMLElement; | ||
expect(iconSpan).toHaveClass(ComponentClassName['RatingIcon']); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters