@@ -684,6 +684,32 @@ describe("MultiComboBox general interaction", () => {
684
684
await browser . url ( `http://localhost:${ PORT } /test-resources/pages/MultiComboBox.html` ) ;
685
685
} ) ;
686
686
687
+ it ( "tests text selection on focus" , async ( ) => {
688
+ const mcb = await browser . $ ( "#multi-acv" ) ;
689
+ const mcb2 = await browser . $ ( "#mcb-with-placeholder" ) ;
690
+
691
+ await mcb . click ( ) ;
692
+
693
+ const selectionStartIndex = await browser . execute ( ( ) => {
694
+ return document . querySelector ( "#multi-acv" ) . shadowRoot . querySelector ( "input" ) . selectionStart ;
695
+ } ) ;
696
+ const selectionEndIndex = await browser . execute ( ( ) => {
697
+ return document . querySelector ( "#multi-acv" ) . shadowRoot . querySelector ( "input" ) . selectionEnd ;
698
+ } ) ;
699
+
700
+ assert . equal ( await selectionStartIndex , 0 , "The selection starts from the beginning of the value" ) ;
701
+ assert . equal ( await selectionEndIndex , 3 , "The whole value is selected" ) ;
702
+
703
+ await mcb . keys ( "Tab" ) ;
704
+ assert . equal ( await mcb2 . getProperty ( "focused" ) , true , "The next control is focused" ) ;
705
+
706
+ await mcb2 . keys ( [ "Shift" , "Tab" ] ) ;
707
+ assert . equal ( await selectionStartIndex , 0 , "The selection starts from the beginning of the value" ) ;
708
+ assert . equal ( await selectionEndIndex , 3 , "The whole value is selected" ) ;
709
+
710
+
711
+ } ) ;
712
+
687
713
it ( "tests two-column layout" , async ( ) => {
688
714
const mcb = await browser . $ ( "#mcb-two-column-layout" ) ;
689
715
const staticAreaItemClassName = await browser . getStaticAreaItemClassName ( "#mcb-two-column-layout" ) ;
0 commit comments