@@ -15,4 +15,35 @@ describe("BusyIndicator general interaction", () => {
15
15
assert . strictEqual ( input . getProperty ( "value" ) , "0" , "itemClick is not thrown" ) ;
16
16
} ) ;
17
17
18
+ it ( "tests focus handling" , ( ) => {
19
+ const busyIndicator = browser . $ ( "#indicator1" ) ;
20
+ busyIndicator . click ( ) ;
21
+
22
+ let innerFocusElement = browser . execute ( ( ) => {
23
+ return document . getElementById ( "indicator1" ) . shadowRoot . activeElement ;
24
+ } ) ;
25
+
26
+ innerFocusElement = $ ( innerFocusElement ) ;
27
+
28
+ assert . strictEqual ( innerFocusElement . getAttribute ( "class" ) , "ui5-busyindicator-busy-area" , "The correct inner element is focused" ) ;
29
+ } ) ;
30
+
31
+ it ( "tests internal focused element attributes" , ( ) => {
32
+ const busyIndicator = browser . $ ( "#indicator1" ) ;
33
+ busyIndicator . click ( ) ;
34
+ const innerFocusElement = busyIndicator . shadow$ ( ".ui5-busyindicator-busy-area" ) ;
35
+
36
+ assert . strictEqual ( innerFocusElement . getAttribute ( "role" ) , "progressbar" , "Correct 'role' is set" ) ;
37
+ assert . strictEqual ( innerFocusElement . getAttribute ( "tabindex" ) , "0" , "Correct 'tabindex' is set" ) ;
38
+ assert . strictEqual ( innerFocusElement . getAttribute ( "aria-valuemin" ) , "0" , "Correct 'aria-valuemin' is set" ) ;
39
+ assert . strictEqual ( innerFocusElement . getAttribute ( "aria-valuemax" ) , "100" , "Correct 'aria-valuemax' is set" ) ;
40
+ assert . strictEqual ( innerFocusElement . getAttribute ( "aria-valuetext" ) , "Busy" , "Correct 'aria-valuetext' is set" ) ;
41
+ } ) ;
42
+
43
+ it ( "tests content is not reachable with keyboard when active" , ( ) => {
44
+ const busyIndicator = browser . $ ( "#indicatorWithBtn" ) ;
45
+ const defaultSLot = busyIndicator . shadow$ ( "slot" ) ;
46
+
47
+ assert . strictEqual ( defaultSLot . getAttribute ( "tabindex" ) , "-1" , "Slot is not reachable via keyboard" ) ;
48
+ } ) ;
18
49
} ) ;
0 commit comments