@@ -34,6 +34,40 @@ describe("Accessibility", () => {
3434 . should ( "not.have.attr" , "aria-label" ) ;
3535
3636 } ) ;
37+
38+ it ( "should have role=img and aria-label with illustration name when decorative is false" , ( ) => {
39+ cy . mount (
40+ < IllustratedMessage name = "UnableToUpload" decorative = { false } >
41+ </ IllustratedMessage >
42+ ) ;
43+
44+ cy . get ( "[ui5-illustrated-message]" )
45+ . shadow ( )
46+ . find ( ".ui5-illustrated-message-illustration" )
47+ . should ( "have.attr" , "role" , "img" ) ;
48+
49+ cy . get ( "[ui5-illustrated-message]" )
50+ . shadow ( )
51+ . find ( ".ui5-illustrated-message-illustration" )
52+ . should ( "have.attr" , "aria-label" , "UnableToUpload" ) ;
53+ } ) ;
54+
55+ it ( "should have role=img and aria-label with illustration name by default (when decorative is not set)" , ( ) => {
56+ cy . mount (
57+ < IllustratedMessage name = "NoData" >
58+ </ IllustratedMessage >
59+ ) ;
60+
61+ cy . get ( "[ui5-illustrated-message]" )
62+ . shadow ( )
63+ . find ( ".ui5-illustrated-message-illustration" )
64+ . should ( "have.attr" , "role" , "img" ) ;
65+
66+ cy . get ( "[ui5-illustrated-message]" )
67+ . shadow ( )
68+ . find ( ".ui5-illustrated-message-illustration" )
69+ . should ( "have.attr" , "aria-label" , "NoData" ) ;
70+ } ) ;
3771} ) ;
3872
3973describe ( "design" , ( ) => {
0 commit comments