@wordpress/a11y 3.18.1-next.4d3b314fd5.0 → 3.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/package.json +4 -4
- package/src/test/add-container.test.js +15 -12
- package/src/test/clear.test.js +2 -2
- package/src/test/index.test.js +7 -7
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/a11y",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.20.0",
|
|
4
4
|
"description": "Accessibility (a11y) utilities for WordPress.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -29,11 +29,11 @@
|
|
|
29
29
|
"types": "build-types",
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@babel/runtime": "^7.16.0",
|
|
32
|
-
"@wordpress/dom-ready": "^3.
|
|
33
|
-
"@wordpress/i18n": "^4.
|
|
32
|
+
"@wordpress/dom-ready": "^3.20.0",
|
|
33
|
+
"@wordpress/i18n": "^4.20.0"
|
|
34
34
|
},
|
|
35
35
|
"publishConfig": {
|
|
36
36
|
"access": "public"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "a2ff0e6471c88436dad0287beb88d1729aa6f5dd"
|
|
39
39
|
}
|
|
@@ -11,12 +11,13 @@ describe( 'addContainer', () => {
|
|
|
11
11
|
expect( container ).not.toBeNull();
|
|
12
12
|
expect( container.className ).toBe( 'a11y-speak-region' );
|
|
13
13
|
expect( container.id ).toBe( 'a11y-speak-polite' );
|
|
14
|
-
expect( container.
|
|
15
|
-
expect( container.
|
|
16
|
-
expect( container
|
|
14
|
+
expect( container ).toHaveAttribute( 'style' );
|
|
15
|
+
expect( container ).toHaveAttribute( 'aria-live', 'polite' );
|
|
16
|
+
expect( container ).toHaveAttribute(
|
|
17
|
+
'aria-relevant',
|
|
17
18
|
'additions text'
|
|
18
19
|
);
|
|
19
|
-
expect( container.
|
|
20
|
+
expect( container ).toHaveAttribute( 'aria-atomic', 'true' );
|
|
20
21
|
} );
|
|
21
22
|
} );
|
|
22
23
|
|
|
@@ -27,12 +28,13 @@ describe( 'addContainer', () => {
|
|
|
27
28
|
expect( container ).not.toBeNull();
|
|
28
29
|
expect( container.className ).toBe( 'a11y-speak-region' );
|
|
29
30
|
expect( container.id ).toBe( 'a11y-speak-assertive' );
|
|
30
|
-
expect( container.
|
|
31
|
-
expect( container.
|
|
32
|
-
expect( container
|
|
31
|
+
expect( container ).toHaveAttribute( 'style' );
|
|
32
|
+
expect( container ).toHaveAttribute( 'aria-live', 'assertive' );
|
|
33
|
+
expect( container ).toHaveAttribute(
|
|
34
|
+
'aria-relevant',
|
|
33
35
|
'additions text'
|
|
34
36
|
);
|
|
35
|
-
expect( container.
|
|
37
|
+
expect( container ).toHaveAttribute( 'aria-atomic', 'true' );
|
|
36
38
|
} );
|
|
37
39
|
} );
|
|
38
40
|
|
|
@@ -43,12 +45,13 @@ describe( 'addContainer', () => {
|
|
|
43
45
|
expect( container ).not.toBeNull();
|
|
44
46
|
expect( container.className ).toBe( 'a11y-speak-region' );
|
|
45
47
|
expect( container.id ).toBe( 'a11y-speak-polite' );
|
|
46
|
-
expect( container.
|
|
47
|
-
expect( container.
|
|
48
|
-
expect( container
|
|
48
|
+
expect( container ).toHaveAttribute( 'style' );
|
|
49
|
+
expect( container ).toHaveAttribute( 'aria-live', 'polite' );
|
|
50
|
+
expect( container ).toHaveAttribute(
|
|
51
|
+
'aria-relevant',
|
|
49
52
|
'additions text'
|
|
50
53
|
);
|
|
51
|
-
expect( container.
|
|
54
|
+
expect( container ).toHaveAttribute( 'aria-atomic', 'true' );
|
|
52
55
|
} );
|
|
53
56
|
} );
|
|
54
57
|
} );
|
package/src/test/clear.test.js
CHANGED
|
@@ -16,7 +16,7 @@ describe( 'clear', () => {
|
|
|
16
16
|
document.body.appendChild( container2 );
|
|
17
17
|
|
|
18
18
|
clear();
|
|
19
|
-
expect( container1
|
|
20
|
-
expect( container2
|
|
19
|
+
expect( container1 ).toBeEmptyDOMElement();
|
|
20
|
+
expect( container2 ).toBeEmptyDOMElement();
|
|
21
21
|
} );
|
|
22
22
|
} );
|
package/src/test/index.test.js
CHANGED
|
@@ -42,8 +42,8 @@ describe( 'speak', () => {
|
|
|
42
42
|
describe( 'in default mode', () => {
|
|
43
43
|
it( 'should set the textcontent of the polite aria-live region', () => {
|
|
44
44
|
speak( 'default message' );
|
|
45
|
-
expect( containerPolite
|
|
46
|
-
expect( containerAssertive
|
|
45
|
+
expect( containerPolite ).toHaveTextContent( 'default message' );
|
|
46
|
+
expect( containerAssertive ).toBeEmptyDOMElement();
|
|
47
47
|
expect( clear ).toHaveBeenCalled();
|
|
48
48
|
expect( filterMessage ).toHaveBeenCalledWith( 'default message' );
|
|
49
49
|
} );
|
|
@@ -52,8 +52,8 @@ describe( 'speak', () => {
|
|
|
52
52
|
describe( 'in assertive mode', () => {
|
|
53
53
|
it( 'should set the textcontent of the assertive aria-live region', () => {
|
|
54
54
|
speak( 'assertive message', 'assertive' );
|
|
55
|
-
expect( containerPolite
|
|
56
|
-
expect( containerAssertive
|
|
55
|
+
expect( containerPolite ).toBeEmptyDOMElement();
|
|
56
|
+
expect( containerAssertive ).toHaveTextContent(
|
|
57
57
|
'assertive message'
|
|
58
58
|
);
|
|
59
59
|
} );
|
|
@@ -62,8 +62,8 @@ describe( 'speak', () => {
|
|
|
62
62
|
describe( 'in explicit polite mode', () => {
|
|
63
63
|
it( 'should set the textcontent of the polite aria-live region', () => {
|
|
64
64
|
speak( 'polite message', 'polite' );
|
|
65
|
-
expect( containerPolite
|
|
66
|
-
expect( containerAssertive
|
|
65
|
+
expect( containerPolite ).toHaveTextContent( 'polite message' );
|
|
66
|
+
expect( containerAssertive ).toBeEmptyDOMElement();
|
|
67
67
|
} );
|
|
68
68
|
} );
|
|
69
69
|
|
|
@@ -81,7 +81,7 @@ describe( 'speak', () => {
|
|
|
81
81
|
|
|
82
82
|
it( 'should set the textcontent of the polite aria-live region', () => {
|
|
83
83
|
speak( 'message', 'assertive' );
|
|
84
|
-
expect( containerPolite
|
|
84
|
+
expect( containerPolite ).toHaveTextContent( 'message' );
|
|
85
85
|
expect(
|
|
86
86
|
document.getElementById( 'a11y-speak-assertive' )
|
|
87
87
|
).toBeNull();
|