@@ -6,7 +6,7 @@ describe("General API", () => {
6
6
it ( "render initially" , ( ) => {
7
7
const linkRoot = browser . $ ( "ui5-link" ) . shadow$ ( "ui5-link-root" ) ;
8
8
9
- assert . ok ( linkRoot , "Link is rendered" ) ;
9
+ assert . ok ( linkRoot , "Link is rendered. " ) ;
10
10
} ) ;
11
11
12
12
it ( "tests href attributes" , ( ) => {
@@ -16,25 +16,25 @@ describe("General API", () => {
16
16
assert . notOk ( link . getAttribute ( "href" ) , "Render without 'href' by default" ) ;
17
17
18
18
link . setAttribute ( "href" , HREF_ATTRIBUTE ) ;
19
- assert . strictEqual ( link . getAttribute ( "href" ) , HREF_ATTRIBUTE , "href attribute is changed" ) ;
19
+ assert . strictEqual ( link . getAttribute ( "href" ) , HREF_ATTRIBUTE , "The href attribute is changed. " ) ;
20
20
} ) ;
21
21
22
22
it ( "tests target attributes" , ( ) => {
23
23
const link = browser . $ ( "#empty-link-2" ) ;
24
24
const TARGET_ATTRIBUTE = "_blank" ;
25
25
26
- assert . notOk ( link . getAttribute ( "target" ) , "Render without 'target' by default" ) ;
26
+ assert . notOk ( link . getAttribute ( "target" ) , "Render without 'target' by default. " ) ;
27
27
28
28
link . setAttribute ( "target" , TARGET_ATTRIBUTE ) ;
29
- assert . strictEqual ( link . getAttribute ( "target" ) , TARGET_ATTRIBUTE , "target attribute is changed" ) ;
29
+ assert . strictEqual ( link . getAttribute ( "target" ) , TARGET_ATTRIBUTE , "The target attribute is changed. " ) ;
30
30
} ) ;
31
31
32
32
it ( "should wrap the text of the link" , ( ) => {
33
33
const wrappingLabel = browser . $ ( "#wrapping-link" ) ;
34
34
const truncatingLabel = browser . $ ( "#non-wrapping-link" ) ;
35
35
36
36
assert . ok ( wrappingLabel . getSize ( ) . height > truncatingLabel . getSize ( ) . height ) ;
37
- assert . strictEqual ( truncatingLabel . getSize ( ) . height , 16 , "truncated label should be single line" ) ;
37
+ assert . strictEqual ( truncatingLabel . getSize ( ) . height , 16 , "The truncated label should be single line. " ) ;
38
38
} ) ;
39
39
40
40
it ( "should prevent clicking on disabled link" , ( ) => {
@@ -45,14 +45,14 @@ describe("General API", () => {
45
45
disLink . click ( ) ;
46
46
} ) ;
47
47
48
- assert . strictEqual ( input . getValue ( ) , "0" , "Click should not be fired and value of input should not be changed" ) ;
48
+ assert . strictEqual ( input . getValue ( ) , "0" , "Click should not be fired and value of input should not be changed. " ) ;
49
49
50
50
} ) ;
51
51
52
52
it ( "disabled link should not be enabled" , ( ) => {
53
53
const link = browser . $ ( "#disabled-link" ) . shadow$ ( "a" ) . getAttribute ( "disabled" ) ;
54
54
55
- assert . ok ( link , "Disabled link should not be enabled" ) ;
55
+ assert . ok ( link , "Disabled link should not be enabled. " ) ;
56
56
} ) ;
57
57
58
58
it ( "tests prevent default" , ( ) => {
@@ -61,4 +61,17 @@ describe("General API", () => {
61
61
link . click ( ) ;
62
62
assert . ok ( browser . getUrl ( ) . indexOf ( "https://www.google.com" ) === - 1 ) ;
63
63
} ) ;
64
+
65
+ it ( "tests acc attributes" , ( ) => {
66
+ const link1 = browser . $ ( "#ariaLbl" ) . shadow$ ( "a" ) ;
67
+ const link2 = browser . $ ( "#ariaLblBy" ) . shadow$ ( "a" ) ;
68
+
69
+ const ARIA_LABEL_1 = "Text from aria-label" ;
70
+ const ARIA_LABEL_2 = "Text from aria-labelledby" ;
71
+
72
+ assert . strictEqual ( link1 . getAttribute ( "aria-label" ) ,
73
+ ARIA_LABEL_1 , "The aria-label attribute is correct." ) ;
74
+ assert . strictEqual ( link2 . getAttribute ( "aria-label" ) ,
75
+ ARIA_LABEL_2 , "The aria-label attribute is correct." ) ;
76
+ } ) ;
64
77
} ) ;
0 commit comments