11import RangeSlider from "../../src/RangeSlider.js" ;
2+ import { RANGE_SLIDER_START_HANDLE_DESCRIPTION , RANGE_SLIDER_END_HANDLE_DESCRIPTION } from "../../src/generated/i18n/i18n-defaults.js" ;
23
34describe ( "Testing Range Slider interactions" , ( ) => {
45 it ( "Changing the current startValue is reflected" , ( ) => {
@@ -874,7 +875,7 @@ describe("Testing events", () => {
874875 const startValue = rangeSlider . startValue ;
875876
876877 cy . get ( "@startHandle" )
877- . should ( "have.attr" , "aria-label" , "Left handle" ) ;
878+ . should ( "have.attr" , "aria-label" , RangeSlider . i18nBundle . getText ( RANGE_SLIDER_START_HANDLE_DESCRIPTION ) ) ;
878879
879880 cy . get ( "@startHandle" )
880881 . should ( "have.attr" , "aria-valuemin" , `${ minValue } ` ) ;
@@ -903,7 +904,7 @@ describe("Testing events", () => {
903904 const endValue = rangeSlider . endValue ;
904905
905906 cy . get ( "@endHandle" )
906- . should ( "have.attr" , "aria-label" , "Right handle" ) ;
907+ . should ( "have.attr" , "aria-label" , RangeSlider . i18nBundle . getText ( RANGE_SLIDER_END_HANDLE_DESCRIPTION ) ) ;
907908
908909 cy . get ( "@endHandle" )
909910 . should ( "have.attr" , "aria-valuemin" , `${ minValue } ` ) ;
@@ -929,17 +930,17 @@ describe("Testing events", () => {
929930 . find ( "[ui5-slider-handle][handle-type='End']" )
930931 . as ( "endHandle" ) ;
931932
932- cy . get ( "@startHandle" ) . should ( "have.attr" , "aria-label" , "Left handle" ) ;
933- cy . get ( "@endHandle" ) . should ( "have.attr" , "aria-label" , "Right handle" ) ;
933+ cy . get ( "@startHandle" ) . should ( "have.attr" , "aria-label" , RangeSlider . i18nBundle . getText ( RANGE_SLIDER_START_HANDLE_DESCRIPTION ) ) ;
934+ cy . get ( "@endHandle" ) . should ( "have.attr" , "aria-label" , RangeSlider . i18nBundle . getText ( RANGE_SLIDER_END_HANDLE_DESCRIPTION ) ) ;
934935
935936 // Drag start handle past end handle to swap values using real events
936937 cy . get ( "@startHandle" )
937938 . realMouseDown ( )
938939 . realMouseMove ( 100 , 0 )
939940 . realMouseUp ( ) ;
940941
941- cy . get ( "@startHandle" ) . should ( "have.attr" , "aria-label" , "Left handle" ) ;
942- cy . get ( "@endHandle" ) . should ( "have.attr" , "aria-label" , "Right handle" ) ;
942+ cy . get ( "@startHandle" ) . should ( "have.attr" , "aria-label" , RangeSlider . i18nBundle . getText ( RANGE_SLIDER_START_HANDLE_DESCRIPTION ) ) ;
943+ cy . get ( "@endHandle" ) . should ( "have.attr" , "aria-label" , RangeSlider . i18nBundle . getText ( RANGE_SLIDER_END_HANDLE_DESCRIPTION ) ) ;
943944 } ) ;
944945
945946 it ( "Click anywhere in the Range Slider should focus the closest handle" , ( ) => {
@@ -1811,12 +1812,12 @@ describe("Accessibility", () => {
18111812 cy . get ( "[ui5-range-slider]" )
18121813 . shadow ( )
18131814 . find ( "[ui5-slider-handle][handle-type='Start']" )
1814- . should ( "have.attr" , "aria-label" , `${ labelText } Left handle ` ) ;
1815+ . should ( "have.attr" , "aria-label" , `${ labelText } ${ RangeSlider . i18nBundle . getText ( RANGE_SLIDER_START_HANDLE_DESCRIPTION ) } ` ) ;
18151816
18161817 cy . get ( "[ui5-range-slider]" )
18171818 . shadow ( )
18181819 . find ( "[ui5-slider-handle][handle-type='End']" )
1819- . should ( "have.attr" , "aria-label" , `${ labelText } Right handle ` ) ;
1820+ . should ( "have.attr" , "aria-label" , `${ labelText } ${ RangeSlider . i18nBundle . getText ( RANGE_SLIDER_END_HANDLE_DESCRIPTION ) } ` ) ;
18201821 } ) ;
18211822
18221823 it ( "Aria attributes of the progress bar are set correctly" , ( ) => {
0 commit comments