@@ -34,4 +34,31 @@ describe("Panel general interaction", () => {
34
34
35
35
assert . strictEqual ( field . getProperty ( "value" ) , "3" , "Press should be called 3 times" ) ;
36
36
} ) ;
37
+
38
+ describe ( "Accessibility" , ( ) => {
39
+
40
+ it ( "tests whether aria attributes are set correctly with native header" , ( ) => {
41
+ const header = browser . $ ( "#panel1" ) . shadow$ ( ".ui5-panel-header" ) ;
42
+ const button = browser . $ ( "#panel1" ) . shadow$ ( ".ui5-panel-header-button" ) ;
43
+
44
+ assert . ok ( ! button . getAttribute ( "aria-expanded" ) , "aria-expanded shouldn't be set on the button" ) ;
45
+ assert . ok ( ! button . getAttribute ( "aria-controls" ) , "aria-controls shouldn't be set on the button" ) ;
46
+ assert . ok ( ! button . getAttribute ( "title" ) , "title shouldn't be set on the button" ) ;
47
+
48
+ assert . ok ( header . getAttribute ( "aria-expanded" ) , "aria-expanded should be set on the header" ) ;
49
+ assert . ok ( header . getAttribute ( "aria-controls" ) , "aria-controls should be set on the header" ) ;
50
+ } ) ;
51
+
52
+ it ( "tests whether aria attributes are set correctly in case of custom header" , ( ) => {
53
+ const button = browser . $ ( "#panel2" ) . shadow$ ( ".ui5-panel-header-button" ) . shadow$ ( ".ui5-button-root" ) ;
54
+ const header = browser . $ ( "#panel2" ) . shadow$ ( ".ui5-panel-header" ) ;
55
+
56
+ assert . ok ( ! header . getAttribute ( "aria-expanded" ) , "aria-expanded shouldn't be set on the header" ) ;
57
+ assert . ok ( ! header . getAttribute ( "aria-controls" ) , "aria-controls shouldn't be set on the header" ) ;
58
+
59
+ assert . ok ( button . getAttribute ( "aria-expanded" ) , "aria-expanded should be set on the button" ) ;
60
+ assert . ok ( button . getAttribute ( "aria-controls" ) , "aria-controls should be set on the button" ) ;
61
+ assert . ok ( button . getAttribute ( "title" ) , "title should be set on the button" ) ;
62
+ } ) ;
63
+ } ) ;
37
64
} ) ;
0 commit comments