diff --git a/src/components/Icon/index.tsx b/src/components/Icon/index.tsx index 51d398a3e85d..0bf07bb964bd 100644 --- a/src/components/Icon/index.tsx +++ b/src/components/Icon/index.tsx @@ -173,6 +173,9 @@ function Icon({ {char} {isFocused && !isDisableKeyboard && ( - + {!!char && {char}} │ diff --git a/tests/ui/LHNItemsPresence.tsx b/tests/ui/LHNItemsPresence.tsx index 6fb7cfea6e41..7d0e8550bc0b 100644 --- a/tests/ui/LHNItemsPresence.tsx +++ b/tests/ui/LHNItemsPresence.tsx @@ -222,7 +222,7 @@ describe('SidebarLinksData', () => { expect(getDisplayNames()).toHaveLength(1); // And the draft icon should be shown, indicating there is unsent content. - expect(screen.getByTestId('Pencil Icon')).toBeOnTheScreen(); + expect(screen.getByTestId('Pencil Icon', {includeHiddenElements: true})).toBeOnTheScreen(); }); it('should display pinned report', async () => { @@ -250,7 +250,7 @@ describe('SidebarLinksData', () => { expect(getOptionRows()).toHaveLength(1); // And the pin icon should be shown - expect(screen.getByTestId('Pin Icon')).toBeOnTheScreen(); + expect(screen.getByTestId('Pin Icon', {includeHiddenElements: true})).toBeOnTheScreen(); }); it('should display the report with violations', async () => { @@ -299,7 +299,7 @@ describe('SidebarLinksData', () => { await waitForBatchedUpdatesWithAct(); // Then the RBR icon should be shown - expect(screen.getByTestId('RBR Icon')).toBeOnTheScreen(); + expect(screen.getByTestId('RBR Icon', {includeHiddenElements: true})).toBeOnTheScreen(); }); it('should display the report awaiting user action', async () => { @@ -321,7 +321,7 @@ describe('SidebarLinksData', () => { expect(getOptionRows()).toHaveLength(1); // And a green dot icon should be shown - expect(screen.getByTestId('GBR Icon')).toBeOnTheScreen(); + expect(screen.getByTestId('GBR Icon', {includeHiddenElements: true})).toBeOnTheScreen(); }); it('should display the archived report in the default mode', async () => { @@ -723,7 +723,7 @@ describe('SidebarLinksData', () => { expect(getDisplayNames()).toHaveLength(1); // And the GBR icon should be shown, indicating there is require action from current user. - expect(screen.getByTestId('GBR Icon')).toBeOnTheScreen(); + expect(screen.getByTestId('GBR Icon', {includeHiddenElements: true})).toBeOnTheScreen(); }); it('should display the report with GRB when the report has unread mention', async () => { @@ -745,7 +745,7 @@ describe('SidebarLinksData', () => { expect(getDisplayNames()).toHaveLength(1); // And the GRB icon should be shown, indicating there is unread mention. - expect(screen.getByTestId('GBR Icon')).toBeOnTheScreen(); + expect(screen.getByTestId('GBR Icon', {includeHiddenElements: true})).toBeOnTheScreen(); }); }); }); diff --git a/tests/unit/AvatarButtonWithIconTest.tsx b/tests/unit/AvatarButtonWithIconTest.tsx index ac9b2bf760f0..54ec1964de53 100644 --- a/tests/unit/AvatarButtonWithIconTest.tsx +++ b/tests/unit/AvatarButtonWithIconTest.tsx @@ -74,7 +74,7 @@ describe('AvatarButtonWithIcon', () => { it('should render edit icon when not disabled', () => { renderWithProvider(); - expect(screen.getByTestId(ICON_TEST_ID)).toBeTruthy(); + expect(screen.getByTestId(ICON_TEST_ID, {includeHiddenElements: true})).toBeTruthy(); }); it('should not render edit icon when disabled', () => { @@ -98,7 +98,7 @@ describe('AvatarButtonWithIcon', () => { />, ); expect(screen.getByLabelText(defaultProps.text)).toBeTruthy(); - expect(screen.getByTestId(MOCK_TEST_ID)).toBeTruthy(); + expect(screen.getByTestId(MOCK_TEST_ID, {includeHiddenElements: true})).toBeTruthy(); }); it.each([CONST.AVATAR_SIZE.DEFAULT, CONST.AVATAR_SIZE.LARGE, CONST.AVATAR_SIZE.X_LARGE])('should render with size: %s', (size) => { diff --git a/tests/unit/SidebarOrderTest.ts b/tests/unit/SidebarOrderTest.ts index 0a3950912155..7daab412f0a1 100644 --- a/tests/unit/SidebarOrderTest.ts +++ b/tests/unit/SidebarOrderTest.ts @@ -219,7 +219,7 @@ describe('Sidebar', () => { // Then there should be a pencil icon and report one should be the first one because putting a draft on the active report should change its location // in the ordered list .then(() => { - const pencilIcon = screen.queryAllByTestId('Pencil Icon'); + const pencilIcon = screen.queryAllByTestId('Pencil Icon', {includeHiddenElements: true}); expect(pencilIcon).toHaveLength(1); const hintText = TestHelper.translateLocal('accessibilityHints.chatUserDisplayNames'); const displayNames = screen.queryAllByLabelText(hintText); @@ -579,7 +579,7 @@ describe('Sidebar', () => { // Then there should be a pencil icon showing .then(() => { - expect(screen.queryAllByTestId('Pencil Icon')).toHaveLength(1); + expect(screen.queryAllByTestId('Pencil Icon', {includeHiddenElements: true})).toHaveLength(1); }) // When the draft is removed @@ -620,7 +620,7 @@ describe('Sidebar', () => { // Then there should be a pencil icon showing .then(() => { - expect(screen.queryAllByTestId('Pin Icon')).toHaveLength(1); + expect(screen.queryAllByTestId('Pin Icon', {includeHiddenElements: true})).toHaveLength(1); }) // When the draft is removed @@ -710,8 +710,8 @@ describe('Sidebar', () => { const hintText = TestHelper.translateLocal('accessibilityHints.chatUserDisplayNames'); const displayNames = screen.queryAllByLabelText(hintText); expect(displayNames).toHaveLength(4); - expect(screen.queryAllByTestId('Pin Icon')).toHaveLength(1); - expect(screen.queryAllByTestId('Pencil Icon')).toHaveLength(1); + expect(screen.queryAllByTestId('Pin Icon', {includeHiddenElements: true})).toHaveLength(1); + expect(screen.queryAllByTestId('Pencil Icon', {includeHiddenElements: true})).toHaveLength(1); expect(displayNames.at(0)).toHaveTextContent('Email Four'); expect(displayNames.at(1)).toHaveTextContent('Email Two'); expect(displayNames.at(2)).toHaveTextContent('Email Three'); diff --git a/tests/unit/libs/Avatars/__snapshots__/InitialAvatarsTest.tsx.snap b/tests/unit/libs/Avatars/__snapshots__/InitialAvatarsTest.tsx.snap index 173133778a64..80ea3f259887 100644 --- a/tests/unit/libs/Avatars/__snapshots__/InitialAvatarsTest.tsx.snap +++ b/tests/unit/libs/Avatars/__snapshots__/InitialAvatarsTest.tsx.snap @@ -2,6 +2,9 @@ exports[`getInitialAvatarSvg matches snapshot for a letter avatar 1`] = ` diff --git a/tests/unit/libs/Avatars/__snapshots__/PresetAvatarCatalogTest.tsx.snap b/tests/unit/libs/Avatars/__snapshots__/PresetAvatarCatalogTest.tsx.snap index e128627080a7..226c9989b0ee 100644 --- a/tests/unit/libs/Avatars/__snapshots__/PresetAvatarCatalogTest.tsx.snap +++ b/tests/unit/libs/Avatars/__snapshots__/PresetAvatarCatalogTest.tsx.snap @@ -2,6 +2,9 @@ exports[`PresetAvatarCatalog matches snapshot for a default avatar 1`] = `