Skip to content

Commit 28edb67

Browse files
committed
refactor: self code review
1 parent 829043c commit 28edb67

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/helpers/accessibility.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,13 @@ export function getRole(element: ReactTestInstance): Role | AccessibilityRole {
149149
return 'none';
150150
}
151151

152+
/**
153+
* There are some duplications between (ARIA) `Role` and `AccessibilityRole` types.
154+
* Resolve them by using ARIA `Role` type where possible.
155+
*
156+
* @param role Role to normalize
157+
* @returns Normalized role
158+
*/
152159
export function normalizeRole(role: string): Role | AccessibilityRole {
153160
if (role === 'image') {
154161
return 'img';

0 commit comments

Comments
 (0)