@@ -21,9 +21,35 @@ describe('Rounded progress bar', function () {
2121 getByText ( container , '50%' ) ;
2222 } ) ;
2323
24- it ( 'should render component and set a correct aria-valuenow value (rounded and formatted )' , async ( ) => {
24+ it ( 'should render component and set a correct aria-valuenow value (numeric )' , async ( ) => {
2525 const { container } = render ( < ProgressBarRounded progress = { 0.5 } size = { SIZE . medium } /> ) ;
2626 const progressBar = getByRole ( container , 'progressbar' ) ;
2727 expect ( progressBar ) . toHaveAttribute ( 'aria-valuenow' , '0.5' ) ;
2828 } ) ;
29+
30+ it ( 'should have aria-live attribute for accessibility' , ( ) => {
31+ const { container } = render ( < ProgressBarRounded progress = { 0.5 } /> ) ;
32+ const progressBar = getByRole ( container , 'progressbar' ) ;
33+ expect ( progressBar ) . toHaveAttribute ( 'aria-live' , 'polite' ) ;
34+ } ) ;
35+
36+ it ( 'should have default aria-label with percentage' , ( ) => {
37+ const { container } = render ( < ProgressBarRounded progress = { 0.75 } /> ) ;
38+ const progressBar = getByRole ( container , 'progressbar' , { name : '75% complete' } ) ;
39+ expect ( progressBar ) . toBeInTheDocument ( ) ;
40+ } ) ;
41+
42+ it ( 'should accept custom aria-label prop' , ( ) => {
43+ const { container } = render ( < ProgressBarRounded progress = { 0.5 } ariaLabel = "Uploading file" /> ) ;
44+ const progressBar = getByRole ( container , 'progressbar' , { name : 'Uploading file' } ) ;
45+ expect ( progressBar ) . toBeInTheDocument ( ) ;
46+ } ) ;
47+
48+ it ( 'should accept custom aria-label via kebab-case prop' , ( ) => {
49+ const { container } = render (
50+ < ProgressBarRounded progress = { 0.5 } aria-label = "Processing data" />
51+ ) ;
52+ const progressBar = getByRole ( container , 'progressbar' , { name : 'Processing data' } ) ;
53+ expect ( progressBar ) . toBeInTheDocument ( ) ;
54+ } ) ;
2955} ) ;
0 commit comments