You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* don't check labels in production
* Log elements that violate missing label check
* Log elements that violate duplicate labels check
* fix to log element
* fix tests that check warnings
* change addLandmark to use binary search
* cleanup binary search
* add blur handler
* add test for blur and refocus landmark
* remove skip
* Fix focus lost to body
* remove environment check (not working)
Co-authored-by: Rob Snow <[email protected]>
console.warn(`Page contains more than one landmark with the '${role}' role. If two or more landmarks on a page share the same role, all must be labeled with an aria-label or aria-labelledby attribute.`);
`Page contains more than one landmark with the '${role}' role. If two or more landmarks on a page share the same role, all must be labeled with an aria-label or aria-labelledby attribute: `,
console.warn(`Page contains more than one landmark with the '${role}' role and '${label}' label. If two or more landmarks on a page share the same role, they must have unique labels.`);
159
+
console.warn(
160
+
`Page contains more than one landmark with the '${role}' role and '${label}' label. If two or more landmarks on a page share the same role, they must have unique labels: `,
@@ -591,13 +591,15 @@ describe('LandmarkManager', function () {
591
591
</div>
592
592
);
593
593
594
-
expect(spyWarn).toHaveBeenCalledWith('Page contains more than one landmark with the \'navigation\' role. If two or more landmarks on a page share the same role, all must be labeled with an aria-label or aria-labelledby attribute.');
594
+
letnavs=tree.getAllByRole('navigation');
595
+
596
+
expect(spyWarn).toHaveBeenCalledWith('Page contains more than one landmark with the \'navigation\' role. If two or more landmarks on a page share the same role, all must be labeled with an aria-label or aria-labelledby attribute: ',navs);
595
597
});
596
598
597
599
it('Should warn if 2+ landmarks with same role and same label',function(){
@@ -618,8 +620,9 @@ describe('LandmarkManager', function () {
618
620
</Main>
619
621
</div>
620
622
);
623
+
letnavs=tree.getAllByRole('navigation');
621
624
622
-
expect(spyWarn).toHaveBeenCalledWith('Page contains more than one landmark with the \'navigation\' role and \'First nav\' label. If two or more landmarks on a page share the same role, they must have unique labels.');
625
+
expect(spyWarn).toHaveBeenCalledWith('Page contains more than one landmark with the \'navigation\' role and \'First nav\' label. If two or more landmarks on a page share the same role, they must have unique labels: ',navs);
623
626
});
624
627
625
628
it('Should not navigate to a landmark that has been removed from the DOM',function(){
@@ -1094,6 +1097,7 @@ describe('LandmarkManager', function () {
1094
1097
</Main>
1095
1098
</div>
1096
1099
);
1100
+
letnavs=tree.getAllByRole('navigation');
1097
1101
1098
1102
expect(spyWarn).not.toHaveBeenCalled();
1099
1103
tree.rerender(
@@ -1116,6 +1120,40 @@ describe('LandmarkManager', function () {
1116
1120
</Main>
1117
1121
</div>
1118
1122
);
1119
-
expect(spyWarn).toHaveBeenCalledWith('Page contains more than one landmark with the \'navigation\' role and \'nav label 1\' label. If two or more landmarks on a page share the same role, they must have unique labels.');
1123
+
expect(spyWarn).toHaveBeenCalledWith('Page contains more than one landmark with the \'navigation\' role and \'nav label 1\' label. If two or more landmarks on a page share the same role, they must have unique labels: ',navs);
1124
+
});
1125
+
1126
+
it('focus restores to previously focused landmark after blur and F6.',function(){
0 commit comments