Skip to content

Commit 0a9623d

Browse files
committed
refactor: self-code review
1 parent 28edb67 commit 0a9623d

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/queries/__tests__/hint-text.test.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ const TEXT_HINT = 'static text';
88
const NO_MATCHES_TEXT: any = 'not-existent-element';
99

1010
const getMultipleInstancesFoundMessage = (value: string) => {
11-
return `Found multiple elements with accessibilityHint: ${value}`;
11+
return `Found multiple elements with accessibility hint: ${value}`;
1212
};
1313

1414
const getNoInstancesFoundMessage = (value: string) => {
15-
return `Unable to find an element with accessibilityHint: ${value}`;
15+
return `Unable to find an element with accessibility hint: ${value}`;
1616
};
1717

1818
const Typography = ({ children, ...rest }: any) => {
@@ -114,7 +114,7 @@ test('byHintText queries support hidden option', () => {
114114
expect(screen.queryByHintText('hidden', { includeHiddenElements: false })).toBeFalsy();
115115
expect(() => screen.getByHintText('hidden', { includeHiddenElements: false }))
116116
.toThrowErrorMatchingInlineSnapshot(`
117-
"Unable to find an element with accessibilityHint: hidden
117+
"Unable to find an element with accessibility hint: hidden
118118
119119
<Text
120120
accessibilityHint="hidden"
@@ -133,7 +133,7 @@ test('error message renders the element tree, preserving only helpful props', as
133133
render(<Pressable accessibilityHint="HINT" key="3" />);
134134

135135
expect(() => screen.getByHintText('FOO')).toThrowErrorMatchingInlineSnapshot(`
136-
"Unable to find an element with accessibilityHint: FOO
136+
"Unable to find an element with accessibility hint: FOO
137137
138138
<View
139139
accessibilityHint="HINT"
@@ -142,7 +142,7 @@ test('error message renders the element tree, preserving only helpful props', as
142142
`);
143143

144144
expect(() => screen.getAllByHintText('FOO')).toThrowErrorMatchingInlineSnapshot(`
145-
"Unable to find an element with accessibilityHint: FOO
145+
"Unable to find an element with accessibility hint: FOO
146146
147147
<View
148148
accessibilityHint="HINT"
@@ -151,7 +151,7 @@ test('error message renders the element tree, preserving only helpful props', as
151151
`);
152152

153153
await expect(screen.findByHintText('FOO')).rejects.toThrowErrorMatchingInlineSnapshot(`
154-
"Unable to find an element with accessibilityHint: FOO
154+
"Unable to find an element with accessibility hint: FOO
155155
156156
<View
157157
accessibilityHint="HINT"
@@ -160,7 +160,7 @@ test('error message renders the element tree, preserving only helpful props', as
160160
`);
161161

162162
await expect(screen.findAllByHintText('FOO')).rejects.toThrowErrorMatchingInlineSnapshot(`
163-
"Unable to find an element with accessibilityHint: FOO
163+
"Unable to find an element with accessibility hint: FOO
164164
165165
<View
166166
accessibilityHint="HINT"

src/queries/hint-text.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ const queryAllByHintText = (
3131
};
3232

3333
const getMultipleError = (hint: TextMatch) =>
34-
`Found multiple elements with accessibilityHint: ${String(hint)} `;
34+
`Found multiple elements with accessibility hint: ${String(hint)} `;
3535
const getMissingError = (hint: TextMatch) =>
36-
`Unable to find an element with accessibilityHint: ${String(hint)}`;
36+
`Unable to find an element with accessibility hint: ${String(hint)}`;
3737

3838
const { getBy, getAllBy, queryBy, queryAllBy, findBy, findAllBy } = makeQueries(
3939
queryAllByHintText,

0 commit comments

Comments
 (0)