-
Notifications
You must be signed in to change notification settings - Fork 163
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: Live announce resultState in ProgressBar #3229
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3229 +/- ##
=======================================
Coverage 96.45% 96.45%
=======================================
Files 790 790
Lines 22299 22299
Branches 7664 7595 -69
=======================================
Hits 21508 21508
Misses 739 739
Partials 52 52 ☔ View full report in Codecov by Sentry. |
0538f0f
to
2facfb8
Compare
@@ -253,8 +261,10 @@ describe('Progress updates', () => { | |||
expect(wrapper.find(`.${liveRegionStyles.root}`)?.getElement().textContent).toBe(`${label}: 0%`); | |||
rerender(<ProgressBar label={label} value={2} />); | |||
|
|||
// 6 seconds passed, live region has a new value | |||
jest.advanceTimersByTime(6000); | |||
act(() => { |
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.
Wrapped with an act
because state updates are happening (https://github.com/cloudscape-design/components/blob/main/src/progress-bar/index.tsx#L55) when running the timers. This removes the related act warning when running the tests.
2facfb8
to
7ea6ad9
Compare
Description
Before this change, the
resultState
was not live-announced when displayed becaue the content of thearia-live
container did not change.With this change, the
InternalLiveRegion
componnt takes care about the live announcement, once theresultState
is rendered.Related links, issue #, if available: AWSUI-60207
How has this been tested?
with-updates
demo page, enable VO and click the "Start" button. Live announcement is happening once the loading is done.Review checklist
The following items are to be evaluated by the author(s) and the reviewer(s).
Correctness
CONTRIBUTING.md
.CONTRIBUTING.md
.Security
checkSafeUrl
function.Testing
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.