@@ -16,7 +16,6 @@ describe("MultiComboBox general interaction", () => {
16
16
assert . ok ( ! popover . getProperty ( "opened" ) , "Popover should close" ) ;
17
17
} ) ;
18
18
19
- /*
20
19
it ( "Checks focus state" , ( ) => {
21
20
const mcb = browser . $ ( "#multi1" ) ;
22
21
const input = mcb . shadow$ ( "#ui5-multi-combobox-input" ) ;
@@ -35,7 +34,6 @@ describe("MultiComboBox general interaction", () => {
35
34
36
35
assert . ok ( mcb . getProperty ( "focused" ) , "MultiComboBox should be focused again." ) ;
37
36
} ) ;
38
- */
39
37
40
38
it ( "MultiComboBox open property is set correctly" , ( ) => {
41
39
const mcb = browser . $ ( "#multi1" ) ;
@@ -111,6 +109,21 @@ describe("MultiComboBox general interaction", () => {
111
109
resetBtn . click ( ) ;
112
110
} ) ;
113
111
112
+ it ( "When popover is opened via icon and item is selected/deselected, focus should return to the MultiComboBox" , ( ) => {
113
+ const icon = browser . $ ( "#mcb-success" ) . shadow$ ( "[input-icon]" ) ;
114
+ const staticAreaItemClassName = browser . getStaticAreaItemClassName ( "#mcb-success" )
115
+ const popover = browser . $ ( `.${ staticAreaItemClassName } ` ) . shadow$ ( ".ui5-multi-combobox-all-items-responsive-popover" ) ;
116
+ const firstItem = popover . $ ( ".ui5-multi-combobox-all-items-list > ui5-li" ) ;
117
+
118
+ icon . click ( ) ;
119
+
120
+ assert . strictEqual ( popover . getProperty ( "opened" ) , true , "The popover should be opened" ) ;
121
+
122
+ firstItem . click ( ) ;
123
+
124
+ assert . ok ( browser . $ ( "#mcb-success" ) . getProperty ( "focused" ) , "MultiComboBox should be focused." ) ;
125
+ } ) ;
126
+
114
127
it ( "Opens all items popover when start typing and filters items" , ( ) => {
115
128
const input = browser . $ ( "#mcb" ) . shadow$ ( "#ui5-multi-combobox-input" ) ;
116
129
const staticAreaItemClassName = browser . getStaticAreaItemClassName ( "#mcb" )
@@ -173,6 +186,7 @@ describe("MultiComboBox general interaction", () => {
173
186
174
187
assert . strictEqual ( popover . getProperty ( "opened" ) , false , "When the content is clicked, the popover should close" ) ;
175
188
assert . strictEqual ( input . getValue ( ) , "" , "When the content is clicked, the value should be removed" ) ;
189
+ assert . ok ( browser . $ ( "#another-mcb" ) . getProperty ( "focused" ) , "MultiComboBox should be focused." ) ;
176
190
} ) ;
177
191
178
192
it ( "When item's checkbox is clicked, the popover should not be closed and the value in the input should be kept" , ( ) => {
0 commit comments