Skip to content

Commit 8e9a7db

Browse files
committed
chore: remove use of accessibility as test id since getAllByText works good
1 parent ea68928 commit 8e9a7db

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

package/src/components/ImageGallery/components/ImageGalleryHeader.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -177,11 +177,7 @@ export const ImageGalleryHeader = <
177177
centerElement({ hideOverlay, photo })
178178
) : (
179179
<View style={[styles.centerContainer, centerContainer]}>
180-
<Text
181-
accessibilityLabel={photo?.user?.name || t('Unknown User')}
182-
accessible={true}
183-
style={[styles.userName, { color: black }, usernameText]}
184-
>
180+
<Text style={[styles.userName, { color: black }, usernameText]}>
185181
{photo?.user?.name || t('Unknown User')}
186182
</Text>
187183
{date && <Text style={[styles.date, { color: black }, dateText]}>{date}</Text>}

package/src/components/ImageGallery/components/__tests__/ImageGalleryHeader.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ it('doesnt fail if fromNow is not available on first render', () => {
1818
sharedValueOpacity = useSharedValue(1);
1919
sharedValueVisible = useSharedValue(1);
2020
});
21-
const { getAllByA11yLabel } = render(
21+
const { getAllByText } = render(
2222
<ThemeProvider>
2323
<ImageGalleryHeader
2424
// @ts-ignore
@@ -32,7 +32,7 @@ it('doesnt fail if fromNow is not available on first render', () => {
3232
/>
3333
</ThemeProvider>,
3434
);
35-
expect(getAllByA11yLabel('Unknown User')).toBeTruthy();
35+
expect(getAllByText('Unknown User')).toBeTruthy();
3636
} catch (error: unknown) {
3737
if (error instanceof Error) {
3838
throw new Error(`Error encountered on first render of ImageGalleryHeader: ${error.message}`);

0 commit comments

Comments
 (0)