From f963855875d84d7c959e41ed6520bb5790ac6bb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Espino=20Garc=C3=ADa?= Date: Tue, 29 Apr 2025 13:56:22 +0200 Subject: [PATCH] Fix Find channels not being interactable (#8794) * Fix Find channels not being interactable * fix(e2e): Uncomment find channel tests * Fix tsc * Use platform select --------- Co-authored-by: yasserfaraazkhan --- app/components/chips/base_chip.tsx | 7 +++++-- .../header/skintone_selector/skintone_selector.tsx | 2 +- .../find_channels/filtered_list/filtered_list.tsx | 4 ++-- .../find_channels/quick_options/quick_options.tsx | 4 ++-- .../find_channels/unfiltered_list/unfiltered_list.tsx | 4 ++-- detox/e2e/test/channels/find_channels.e2e.ts | 9 ++++----- detox/e2e/test/smoke_test/channels.e2e.ts | 3 +-- .../components/search_channels/search_channels.tsx | 4 ++-- 8 files changed, 19 insertions(+), 18 deletions(-) diff --git a/app/components/chips/base_chip.tsx b/app/components/chips/base_chip.tsx index a52fb869d..a1fe166c3 100644 --- a/app/components/chips/base_chip.tsx +++ b/app/components/chips/base_chip.tsx @@ -2,7 +2,7 @@ // See LICENSE.txt for license information. import React from 'react'; -import {Text, TouchableOpacity, useWindowDimensions} from 'react-native'; +import {Platform, Text, TouchableOpacity, useWindowDimensions} from 'react-native'; import Animated, {FadeIn, FadeOut} from 'react-native-reanimated'; import CompassIcon from '@components/compass_icon'; @@ -103,10 +103,13 @@ export default function BaseChip({ ); } + + // https://mattermost.atlassian.net/browse/MM-63814?focusedCommentId=178584 + const useFadeOut = showAnimation && Platform.OS !== 'android'; return ( diff --git a/app/screens/emoji_picker/picker/header/skintone_selector/skintone_selector.tsx b/app/screens/emoji_picker/picker/header/skintone_selector/skintone_selector.tsx index 0039da9aa..37d63dc09 100644 --- a/app/screens/emoji_picker/picker/header/skintone_selector/skintone_selector.tsx +++ b/app/screens/emoji_picker/picker/header/skintone_selector/skintone_selector.tsx @@ -145,7 +145,7 @@ const SkinToneSelector = ({skinTone = 'default', containerWidth, isSearching, tu > diff --git a/app/screens/find_channels/filtered_list/filtered_list.tsx b/app/screens/find_channels/filtered_list/filtered_list.tsx index 6d9414b7d..6d7cb6948 100644 --- a/app/screens/find_channels/filtered_list/filtered_list.tsx +++ b/app/screens/find_channels/filtered_list/filtered_list.tsx @@ -4,7 +4,7 @@ import {debounce, type DebouncedFunc} from 'lodash'; import React, {useCallback, useEffect, useMemo, useRef, useState} from 'react'; import {useIntl} from 'react-intl'; -import {Alert, FlatList, type ListRenderItemInfo, StyleSheet, View} from 'react-native'; +import {Alert, FlatList, type ListRenderItemInfo, Platform, StyleSheet, View} from 'react-native'; import Animated, {FadeInDown, FadeOutUp} from 'react-native-reanimated'; import {switchToGlobalThreads} from '@actions/local/thread'; @@ -336,7 +336,7 @@ const FilteredList = ({ return ( { return ( diff --git a/app/screens/find_channels/unfiltered_list/unfiltered_list.tsx b/app/screens/find_channels/unfiltered_list/unfiltered_list.tsx index ccd45a4e0..4cb1fb494 100644 --- a/app/screens/find_channels/unfiltered_list/unfiltered_list.tsx +++ b/app/screens/find_channels/unfiltered_list/unfiltered_list.tsx @@ -3,7 +3,7 @@ import React, {useCallback, useEffect, useMemo, useState} from 'react'; import {useIntl} from 'react-intl'; -import {SectionList, type SectionListRenderItemInfo, StyleSheet} from 'react-native'; +import {Platform, SectionList, type SectionListRenderItemInfo, StyleSheet} from 'react-native'; import Animated, {FadeInDown, FadeOutUp} from 'react-native-reanimated'; import {switchToChannelById} from '@actions/remote/channel'; @@ -81,7 +81,7 @@ const UnfilteredList = ({close, keyboardOverlap, recentChannels, showTeamName, t return ( { @@ -68,8 +68,7 @@ describe('Channels - Find Channels', () => { await FindChannelsScreen.close(); }); - // TODO: Uncomment this test when the issue is fixed https://mattermost.atlassian.net/browse/MM-63814 - (device.getPlatform() === 'ios' ? it : it.skip)('MM-T4907_2 - should be able to find and navigate to a public channel', async () => { + it('MM-T4907_2 - should be able to find and navigate to a public channel', async () => { // # Open find channels screen and search for a public channel to navigate to await FindChannelsScreen.open(); await FindChannelsScreen.searchInput.replaceText(testChannel.display_name); @@ -99,7 +98,7 @@ describe('Channels - Find Channels', () => { await FindChannelsScreen.close(); }); - (isIos() ? it : it.skip)('MM-T4907_4 - should be able to find direct and group message channels', async () => { + it('MM-T4907_4 - should be able to find direct and group message channels', async () => { // # Create direct and group message channels, open find channels screen, and search for the direct message channel const {user: testOtherUser1} = await User.apiCreateUser(siteOneUrl, {prefix: 'a'}); await Team.apiAddUserToTeam(siteOneUrl, testOtherUser1.id, testTeam.id); @@ -128,7 +127,7 @@ describe('Channels - Find Channels', () => { await ChannelScreen.back(); }); - (device.getPlatform() === 'ios' ? it : it.skip)('MM-T4907_5 - should be able to find an archived channel', async () => { + it('MM-T4907_5 - should be able to find an archived channel', async () => { // # Archive a channel, open find channels screen, and search for the archived channel const {channel: archivedChannel} = await Channel.apiCreateChannel(siteOneUrl, {teamId: testTeam.id}); await Channel.apiAddUserToChannel(siteOneUrl, testUser.id, archivedChannel.id); diff --git a/detox/e2e/test/smoke_test/channels.e2e.ts b/detox/e2e/test/smoke_test/channels.e2e.ts index 06fc8c48f..08551b650 100644 --- a/detox/e2e/test/smoke_test/channels.e2e.ts +++ b/detox/e2e/test/smoke_test/channels.e2e.ts @@ -139,8 +139,7 @@ describe('Smoke Test - Channels', () => { await ChannelScreen.back(); }); - // TODO: Uncomment the test when the issue is fixed https://mattermost.atlassian.net/browse/MM-63814 - it.skip('MM-T4774_4 - should be able to find and edit a channel', async () => { + it('MM-T4774_4 - should be able to find and edit a channel', async () => { // # Open find channels screen, search for the channel to navigate to, and tap on the target channel item await FindChannelsScreen.open(); await FindChannelsScreen.searchInput.replaceText(testChannel.name); diff --git a/share_extension/components/search_channels/search_channels.tsx b/share_extension/components/search_channels/search_channels.tsx index 9742ab459..24b0f3baa 100644 --- a/share_extension/components/search_channels/search_channels.tsx +++ b/share_extension/components/search_channels/search_channels.tsx @@ -4,7 +4,7 @@ import {useNavigation} from '@react-navigation/native'; import React, {useCallback, useMemo} from 'react'; import {useIntl} from 'react-intl'; -import {FlatList, type ListRenderItemInfo, StyleSheet, View} from 'react-native'; +import {FlatList, type ListRenderItemInfo, Platform, StyleSheet, View} from 'react-native'; import Animated, {FadeInDown, FadeOutUp} from 'react-native-reanimated'; import NoResultsWithTerm from '@components/no_results_with_term'; @@ -94,7 +94,7 @@ const SearchChannels = ({ return (