@@ -760,10 +760,25 @@ module.exports = {
760
760
editor . setOption ( 'enableKeyboardAccessibility' , true ) ;
761
761
editor . renderer . $loop . _flush ( ) ;
762
762
763
- editor . focus ( ) ;
763
+ let text = editor . container . querySelector ( ".ace_text-input" ) ;
764
+ assert . equal ( text . getAttribute ( "aria-label" ) , "Cursor at row 1" ) ;
765
+ } ,
766
+
767
+ "test: text input aria label updated on focus" : function ( ) {
768
+ editor . setValue ( "x x\ny y" , - 1 ) ;
769
+ editor . setOption ( 'enableKeyboardAccessibility' , true ) ;
770
+ editor . renderer . $loop . _flush ( ) ;
764
771
765
772
let text = editor . container . querySelector ( ".ace_text-input" ) ;
766
773
assert . equal ( text . getAttribute ( "aria-label" ) , "Cursor at row 1" ) ;
774
+
775
+ editor . focus ( ) ;
776
+ sendEvent ( "keydown" , { key : { code : "ArrowDown" , key : "ArrowDown" , keyCode : 40 } } ) ;
777
+ editor . renderer . $loop . _flush ( ) ;
778
+
779
+ editor . blur ( ) ;
780
+ editor . focus ( ) ;
781
+ assert . equal ( text . getAttribute ( "aria-label" ) , "Cursor at row 2" ) ;
767
782
} ,
768
783
769
784
"test: text input aria label with extra label set" : function ( ) {
@@ -772,8 +787,6 @@ module.exports = {
772
787
editor . setOption ( 'enableKeyboardAccessibility' , true ) ;
773
788
editor . renderer . $loop . _flush ( ) ;
774
789
775
- editor . focus ( ) ;
776
-
777
790
let text = editor . container . querySelector ( ".ace_text-input" ) ;
778
791
assert . equal ( text . getAttribute ( "aria-label" ) , "super cool editor, Cursor at row 1" ) ;
779
792
}
0 commit comments