Skip to content

Commit

Permalink
Upgrade RNTL to the newest version
Browse files Browse the repository at this point in the history
  • Loading branch information
OlimpiaZurek committed Nov 25, 2024
1 parent 787d804 commit 0b174d7
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
16 changes: 11 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,8 @@
"@storybook/react-webpack5": "^8.1.6",
"@storybook/theming": "^8.1.10",
"@svgr/webpack": "^6.0.0",
"@testing-library/jest-native": "5.4.1",
"@testing-library/react-native": "11.5.1",
"@testing-library/jest-native": "5.4.2",
"@testing-library/react-native": "12.8.1",
"@trivago/prettier-plugin-sort-imports": "^4.2.0",
"@types/base-64": "^1.0.2",
"@types/canvas-size": "^1.2.2",
Expand Down
10 changes: 5 additions & 5 deletions tests/ui/UnreadIndicatorsTest.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ function navigateToSidebar(): Promise<void> {

function areYouOnChatListScreen(): boolean {
const hintText = Localize.translateLocal('sidebarScreen.listOfChats');
const sidebarLinks = screen.queryAllByLabelText(hintText);
const sidebarLinks = screen.queryAllByLabelText(hintText, {includeHiddenElements: true});

return !sidebarLinks?.at(0)?.props?.accessibilityElementsHidden;
}
Expand Down Expand Up @@ -365,12 +365,12 @@ describe('Unread Indicators', () => {
await act(() => (NativeNavigation as NativeNavigationMock).triggerTransitionEnd());
// Verify that report we navigated to appears in a "read" state while the original unread report still shows as unread
const hintText = Localize.translateLocal('accessibilityHints.chatUserDisplayNames');
const displayNameTexts = screen.queryAllByLabelText(hintText);
const displayNameTexts = screen.queryAllByLabelText(hintText, {includeHiddenElements: true});
expect(displayNameTexts).toHaveLength(2);
expect((displayNameTexts.at(0)?.props?.style as TextStyle)?.fontWeight).toBe(FontUtils.fontWeight.normal);
expect(screen.getAllByText('C User').at(0)).toBeOnTheScreen();
expect((displayNameTexts.at(1)?.props?.style as TextStyle)?.fontWeight).toBe(FontUtils.fontWeight.bold);
expect(screen.getByText('B User')).toBeOnTheScreen();
expect(screen.getByText('B User', {includeHiddenElements: true})).toBeOnTheScreen();
}));

xit('Manually marking a chat message as unread shows the new line indicator and updates the LHN', () =>
Expand Down Expand Up @@ -524,7 +524,7 @@ describe('Unread Indicators', () => {
.then(() => {
// Verify the chat preview text matches the last comment from the current user
const hintText = Localize.translateLocal('accessibilityHints.lastChatMessagePreview');
const alternateText = screen.queryAllByLabelText(hintText);
const alternateText = screen.queryAllByLabelText(hintText, {includeHiddenElements: true});
expect(alternateText).toHaveLength(1);

// This message is visible on the sidebar and the report screen, so there are two occurrences.
Expand All @@ -537,7 +537,7 @@ describe('Unread Indicators', () => {
})
.then(() => {
const hintText = Localize.translateLocal('accessibilityHints.lastChatMessagePreview');
const alternateText = screen.queryAllByLabelText(hintText);
const alternateText = screen.queryAllByLabelText(hintText, {includeHiddenElements: true});
expect(alternateText).toHaveLength(1);
expect(screen.getAllByText('Comment 9').at(0)).toBeOnTheScreen();
})
Expand Down

0 comments on commit 0b174d7

Please sign in to comment.