@planningcenter/chat-react-native 4.8.0-rc.1 → 4.8.0-rc.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/components/conversations/bulk_conversation_actions_bar.d.ts +2 -0
- package/build/components/conversations/bulk_conversation_actions_bar.d.ts.map +1 -0
- package/build/components/conversations/bulk_conversation_actions_bar.js +215 -0
- package/build/components/conversations/bulk_conversation_actions_bar.js.map +1 -0
- package/build/components/conversations/conversation_actions.d.ts +2 -1
- package/build/components/conversations/conversation_actions.d.ts.map +1 -1
- package/build/components/conversations/conversation_actions.js +173 -130
- package/build/components/conversations/conversation_actions.js.map +1 -1
- package/build/components/conversations/conversation_preview.d.ts.map +1 -1
- package/build/components/conversations/conversation_preview.js +168 -110
- package/build/components/conversations/conversation_preview.js.map +1 -1
- package/build/components/conversations/conversations.d.ts.map +1 -1
- package/build/components/conversations/conversations.js +50 -48
- package/build/components/conversations/conversations.js.map +1 -1
- package/build/components/display/checkbox.d.ts +8 -0
- package/build/components/display/checkbox.d.ts.map +1 -0
- package/build/components/display/checkbox.js +87 -0
- package/build/components/display/checkbox.js.map +1 -0
- package/build/components/display/icon.d.ts +3 -1
- package/build/components/display/icon.d.ts.map +1 -1
- package/build/components/display/icon.js +2 -0
- package/build/components/display/icon.js.map +1 -1
- package/build/components/display/index.d.ts +1 -0
- package/build/components/display/index.d.ts.map +1 -1
- package/build/components/display/index.js +1 -0
- package/build/components/display/index.js.map +1 -1
- package/build/contexts/api_provider.d.ts.map +1 -1
- package/build/contexts/api_provider.js +2 -0
- package/build/contexts/api_provider.js.map +1 -1
- package/build/contexts/chat_context.d.ts +0 -2
- package/build/contexts/chat_context.d.ts.map +1 -1
- package/build/contexts/chat_context.js +16 -93
- package/build/contexts/chat_context.js.map +1 -1
- package/build/contexts/conversations_context.d.ts +5 -0
- package/build/contexts/conversations_context.d.ts.map +1 -1
- package/build/contexts/conversations_context.js +121 -32
- package/build/contexts/conversations_context.js.map +1 -1
- package/build/contexts/session_context.d.ts +0 -1
- package/build/contexts/session_context.d.ts.map +1 -1
- package/build/contexts/session_context.js +3 -0
- package/build/contexts/session_context.js.map +1 -1
- package/build/hooks/groups/use_group_chat_conversation_payload.d.ts +11 -1
- package/build/hooks/groups/use_group_chat_conversation_payload.d.ts.map +1 -1
- package/build/hooks/groups/use_group_chat_conversation_payload.js +92 -47
- package/build/hooks/groups/use_group_chat_conversation_payload.js.map +1 -1
- package/build/hooks/groups/use_group_members_for_new_conversation.d.ts +27 -25
- package/build/hooks/groups/use_group_members_for_new_conversation.d.ts.map +1 -1
- package/build/hooks/groups/use_group_members_for_new_conversation.js +125 -110
- package/build/hooks/groups/use_group_members_for_new_conversation.js.map +1 -1
- package/build/hooks/groups/use_groups_conversation_create.d.ts.map +1 -1
- package/build/hooks/groups/use_groups_conversation_create.js +39 -31
- package/build/hooks/groups/use_groups_conversation_create.js.map +1 -1
- package/build/hooks/groups/use_groups_proxy.d.ts +2 -0
- package/build/hooks/groups/use_groups_proxy.d.ts.map +1 -0
- package/build/hooks/groups/use_groups_proxy.js +18 -0
- package/build/hooks/groups/use_groups_proxy.js.map +1 -0
- package/build/hooks/use_bulk_conversation_actions.d.ts +8 -0
- package/build/hooks/use_bulk_conversation_actions.d.ts.map +1 -0
- package/build/hooks/use_bulk_conversation_actions.js +309 -0
- package/build/hooks/use_bulk_conversation_actions.js.map +1 -0
- package/build/hooks/use_conversation_jolt_events.d.ts.map +1 -1
- package/build/hooks/use_conversation_jolt_events.js +3 -2
- package/build/hooks/use_conversation_jolt_events.js.map +1 -1
- package/build/hooks/use_conversations_actions.d.ts +9 -9
- package/build/hooks/use_conversations_actions.d.ts.map +1 -1
- package/build/hooks/use_conversations_actions.js +12 -7
- package/build/hooks/use_conversations_actions.js.map +1 -1
- package/build/hooks/use_conversations_cache.d.ts +15 -5
- package/build/hooks/use_conversations_cache.d.ts.map +1 -1
- package/build/hooks/use_conversations_cache.js +170 -122
- package/build/hooks/use_conversations_cache.js.map +1 -1
- package/build/hooks/use_conversations_jolt_events.d.ts.map +1 -1
- package/build/hooks/use_conversations_jolt_events.js +47 -20
- package/build/hooks/use_conversations_jolt_events.js.map +1 -1
- package/build/hooks/use_features.d.ts +1 -0
- package/build/hooks/use_features.d.ts.map +1 -1
- package/build/hooks/use_features.js +1 -0
- package/build/hooks/use_features.js.map +1 -1
- package/build/hooks/use_groups_groups.d.ts.map +1 -1
- package/build/hooks/use_groups_groups.js +25 -9
- package/build/hooks/use_groups_groups.js.map +1 -1
- package/build/hooks/use_mark_latest_message_read.d.ts.map +1 -1
- package/build/hooks/use_mark_latest_message_read.js +5 -4
- package/build/hooks/use_mark_latest_message_read.js.map +1 -1
- package/build/hooks/use_new_conversation_from_filter.d.ts.map +1 -1
- package/build/hooks/use_new_conversation_from_filter.js +11 -1
- package/build/hooks/use_new_conversation_from_filter.js.map +1 -1
- package/build/hooks/use_product_analytics.d.ts.map +1 -1
- package/build/hooks/use_product_analytics.js +93 -75
- package/build/hooks/use_product_analytics.js.map +1 -1
- package/build/navigation/index.d.ts.map +1 -1
- package/build/navigation/index.js +5 -7
- package/build/navigation/index.js.map +1 -1
- package/build/screens/conversation_actions_screen.d.ts +2 -0
- package/build/screens/conversation_actions_screen.d.ts.map +1 -1
- package/build/screens/conversation_actions_screen.js +380 -46
- package/build/screens/conversation_actions_screen.js.map +1 -1
- package/build/screens/conversation_filter_recipients/components/checkbox_row.d.ts.map +1 -1
- package/build/screens/conversation_filter_recipients/components/checkbox_row.js +9 -64
- package/build/screens/conversation_filter_recipients/components/checkbox_row.js.map +1 -1
- package/build/screens/conversation_new/components/groups_form.d.ts.map +1 -1
- package/build/screens/conversation_new/components/groups_form.js +96 -93
- package/build/screens/conversation_new/components/groups_form.js.map +1 -1
- package/build/screens/conversations/conversations_screen.d.ts +5 -0
- package/build/screens/conversations/conversations_screen.d.ts.map +1 -1
- package/build/screens/conversations/conversations_screen.js +156 -31
- package/build/screens/conversations/conversations_screen.js.map +1 -1
- package/build/types/jolt_events/index.d.ts +2 -0
- package/build/types/jolt_events/index.d.ts.map +1 -1
- package/build/types/jolt_events/index.js.map +1 -1
- package/build/types/jolt_events/person_events.d.ts +9 -0
- package/build/types/jolt_events/person_events.d.ts.map +1 -0
- package/build/types/jolt_events/person_events.js +2 -0
- package/build/types/jolt_events/person_events.js.map +1 -0
- package/build/types/resources/groups/groups_group_resource.d.ts +1 -1
- package/build/types/resources/groups/groups_group_resource.d.ts.map +1 -1
- package/build/types/resources/groups/groups_group_resource.js.map +1 -1
- package/build/types/resources/groups/groups_membership_resource.d.ts +11 -0
- package/build/types/resources/groups/groups_membership_resource.d.ts.map +1 -0
- package/build/types/resources/groups/groups_membership_resource.js +2 -0
- package/build/types/resources/groups/groups_membership_resource.js.map +1 -0
- package/build/types/resources/groups/index.d.ts +1 -0
- package/build/types/resources/groups/index.d.ts.map +1 -1
- package/build/types/resources/groups/index.js +1 -0
- package/build/types/resources/groups/index.js.map +1 -1
- package/build/utils/jolt/parse_stream_user_event_type.d.ts +3 -0
- package/build/utils/jolt/parse_stream_user_event_type.d.ts.map +1 -0
- package/build/utils/jolt/parse_stream_user_event_type.js +9 -0
- package/build/utils/jolt/parse_stream_user_event_type.js.map +1 -0
- package/build/utils/native_adapters/configuration.d.ts +3 -0
- package/build/utils/native_adapters/configuration.d.ts.map +1 -1
- package/build/utils/native_adapters/configuration.js +3 -0
- package/build/utils/native_adapters/configuration.js.map +1 -1
- package/build/utils/native_adapters/index.d.ts +1 -0
- package/build/utils/native_adapters/index.d.ts.map +1 -1
- package/build/utils/native_adapters/index.js +1 -0
- package/build/utils/native_adapters/index.js.map +1 -1
- package/build/utils/native_adapters/updates.d.ts +11 -0
- package/build/utils/native_adapters/updates.d.ts.map +1 -0
- package/build/utils/native_adapters/updates.js +8 -0
- package/build/utils/native_adapters/updates.js.map +1 -0
- package/build/utils/product_analytics_token.d.ts +12 -0
- package/build/utils/product_analytics_token.d.ts.map +1 -0
- package/build/utils/product_analytics_token.js +84 -0
- package/build/utils/product_analytics_token.js.map +1 -0
- package/build/utils/throttled_refresh.d.ts +7 -0
- package/build/utils/throttled_refresh.d.ts.map +1 -0
- package/build/utils/throttled_refresh.js +42 -0
- package/build/utils/throttled_refresh.js.map +1 -0
- package/package.json +2 -2
- package/src/__tests__/contexts/session_context.tsx +19 -39
- package/src/__tests__/hooks/useTheme.tsx +0 -7
- package/src/__tests__/hooks/use_async_storage.test.tsx +1 -87
- package/src/__tests__/hooks/use_attachment_uploader.test.tsx +0 -11
- package/src/__tests__/hooks/use_font_scale.test.ts +0 -25
- package/src/__tests__/hooks/use_group_chat_conversation_payload.test.tsx +31 -0
- package/src/__tests__/utils/cache/page_mutations.ts +3 -68
- package/src/__tests__/utils/client.ts +6 -15
- package/src/__tests__/utils/native_adapters/configuration.ts +15 -50
- package/src/__tests__/utils/parse_simple_markdown.ts +0 -6
- package/src/__tests__/utils/session.ts +0 -11
- package/src/__tests__/utils/theme.ts +0 -17
- package/src/components/conversations/__tests__/bulk_conversation_actions_bar.test.tsx +95 -0
- package/src/components/conversations/__tests__/conversation_actions.test.tsx +35 -3
- package/src/components/conversations/__tests__/conversation_preview.test.tsx +69 -3
- package/src/components/conversations/__tests__/conversations.test.tsx +4 -1
- package/src/components/conversations/bulk_conversation_actions_bar.tsx +140 -0
- package/src/components/conversations/conversation_actions.tsx +17 -9
- package/src/components/conversations/conversation_preview.tsx +20 -2
- package/src/components/conversations/conversations.tsx +2 -1
- package/src/components/display/__tests__/filter_dropdown.test.tsx +1 -19
- package/src/components/display/__tests__/icon_tile.test.tsx +24 -7
- package/src/components/display/checkbox.tsx +47 -0
- package/src/components/display/icon.tsx +3 -0
- package/src/components/display/index.ts +1 -0
- package/src/components/page/__tests__/component_error_boundary.test.tsx +0 -12
- package/src/contexts/__tests__/conversations_context.test.tsx +86 -0
- package/src/contexts/api_provider.tsx +2 -0
- package/src/contexts/chat_context.tsx +2 -58
- package/src/contexts/conversations_context.tsx +69 -2
- package/src/contexts/session_context.tsx +3 -1
- package/src/hooks/__tests__/jolt_refresh_throttling.test.tsx +194 -0
- package/src/hooks/__tests__/use_bulk_conversation_actions.test.tsx +119 -0
- package/src/hooks/__tests__/use_conversations_jolt_events.test.tsx +1 -0
- package/src/hooks/__tests__/use_conversations_mark_read.test.tsx +38 -12
- package/src/hooks/__tests__/use_hide_conversation.test.tsx +15 -3
- package/src/hooks/__tests__/use_mark_latest_message_read.test.tsx +23 -2
- package/src/hooks/__tests__/use_product_analytics.test.tsx +304 -0
- package/src/hooks/groups/use_group_chat_conversation_payload.ts +30 -12
- package/src/hooks/groups/use_group_members_for_new_conversation.ts +49 -18
- package/src/hooks/groups/use_groups_conversation_create.ts +10 -14
- package/src/hooks/groups/use_groups_proxy.ts +6 -0
- package/src/hooks/use_bulk_conversation_actions.ts +173 -0
- package/src/hooks/use_conversation_jolt_events.ts +2 -1
- package/src/hooks/use_conversations_actions.ts +7 -4
- package/src/hooks/use_conversations_cache.ts +33 -26
- package/src/hooks/use_conversations_jolt_events.ts +24 -10
- package/src/hooks/use_features.ts +1 -0
- package/src/hooks/use_groups_groups.ts +21 -16
- package/src/hooks/use_mark_latest_message_read.ts +6 -5
- package/src/hooks/use_new_conversation_from_filter.ts +13 -5
- package/src/hooks/use_product_analytics.ts +74 -41
- package/src/navigation/index.tsx +8 -8
- package/src/screens/__tests__/conversation_actions_screen.test.tsx +48 -6
- package/src/screens/__tests__/conversation_details_screen.test.tsx +0 -19
- package/src/screens/avatar_picker/__tests__/avatar_picker_state.test.ts +0 -14
- package/src/screens/conversation_actions_screen.tsx +145 -12
- package/src/screens/conversation_filter_recipients/components/checkbox_row.tsx +3 -35
- package/src/screens/conversation_new/components/groups_form.tsx +11 -9
- package/src/screens/conversations/__tests__/conversations_screen.test.tsx +35 -9
- package/src/screens/conversations/components/__tests__/filter_dropdown_list_header_component.test.tsx +0 -8
- package/src/screens/conversations/components/__tests__/search_list_header_component.test.tsx +0 -10
- package/src/screens/conversations/conversations_screen.tsx +67 -3
- package/src/screens/search/components/__tests__/search_results_list.test.tsx +1 -0
- package/src/types/jolt_events/index.ts +2 -0
- package/src/types/jolt_events/person_events.ts +16 -0
- package/src/types/resources/groups/groups_group_resource.ts +1 -1
- package/src/types/resources/groups/groups_membership_resource.ts +10 -0
- package/src/types/resources/groups/index.ts +1 -0
- package/src/utils/__tests__/attachment_kind.test.ts +0 -4
- package/src/utils/__tests__/convert_attachments_for_create.test.ts +0 -28
- package/src/utils/__tests__/is_input_editable.test.ts +1 -2
- package/src/utils/__tests__/message_text.test.ts +0 -5
- package/src/utils/__tests__/session_manager.test.ts +0 -83
- package/src/utils/__tests__/sha_256.test.ts +0 -34
- package/src/utils/__tests__/throttled_refresh.test.ts +101 -0
- package/src/utils/__tests__/uri.test.ts +51 -0
- package/src/utils/jolt/__tests__/parse_stream_user_event_type.test.ts +27 -0
- package/src/utils/jolt/parse_stream_user_event_type.ts +16 -0
- package/src/utils/native_adapters/configuration.ts +5 -0
- package/src/utils/native_adapters/index.ts +1 -0
- package/src/utils/native_adapters/updates.ts +16 -0
- package/src/utils/product_analytics_token.ts +120 -0
- package/src/utils/throttled_refresh.ts +62 -0
- package/src/__tests__/event-polyfill.test.ts +0 -313
- package/src/__tests__/index.tsx +0 -5
- package/src/__tests__/jest.ts +0 -11
- package/src/__tests__/utils/uri.ts +0 -65
- package/src/components/display/__tests__/version_footer.test.tsx +0 -48
- package/src/screens/search/components/__tests__/search_blank_states.test.tsx +0 -20
- package/src/utils/__tests__/membership_sync_info_text.test.ts +0 -15
package/src/navigation/index.tsx
CHANGED
|
@@ -60,7 +60,10 @@ import {
|
|
|
60
60
|
ConversationSelectTypeScreen,
|
|
61
61
|
ConversationSelectTypeScreenOptions,
|
|
62
62
|
} from '../screens/conversation_select_type_screen'
|
|
63
|
-
import {
|
|
63
|
+
import {
|
|
64
|
+
ConversationsScreen,
|
|
65
|
+
conversationsScreenOptions,
|
|
66
|
+
} from '../screens/conversations/conversations_screen'
|
|
64
67
|
import { GetHelpScreen } from '../screens/get_help_screen'
|
|
65
68
|
import {
|
|
66
69
|
GroupNotificationLevelSelectScreen,
|
|
@@ -181,13 +184,10 @@ export const ChatStack = createNativeStackNavigator({
|
|
|
181
184
|
Conversations: {
|
|
182
185
|
screen: ConversationsScreen,
|
|
183
186
|
options: ({ route, navigation }) =>
|
|
184
|
-
|
|
185
|
-
{
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
},
|
|
189
|
-
withRightClose({ onPress: navigation.goBack })
|
|
190
|
-
),
|
|
187
|
+
conversationsScreenOptions({
|
|
188
|
+
title: (route.params as { title?: string })?.title,
|
|
189
|
+
onClose: navigation.goBack,
|
|
190
|
+
}),
|
|
191
191
|
},
|
|
192
192
|
ConversationFilters: {
|
|
193
193
|
screen: ConversationFiltersScreen,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { DefaultTheme, ThemeProvider } from '@react-navigation/native'
|
|
1
|
+
import { DefaultTheme, StackActions, ThemeProvider } from '@react-navigation/native'
|
|
2
2
|
import { fireEvent, render } from '@testing-library/react-native'
|
|
3
3
|
import React from 'react'
|
|
4
4
|
import { SafeAreaProvider } from 'react-native-safe-area-context'
|
|
5
5
|
import type { ConversationResource } from '../../types'
|
|
6
6
|
import { ConversationActionsScreen } from '../conversation_actions_screen'
|
|
7
7
|
|
|
8
|
-
const mockNavigation = { goBack: jest.fn() }
|
|
8
|
+
const mockNavigation = { goBack: jest.fn(), dispatch: jest.fn(), navigate: jest.fn() }
|
|
9
9
|
jest.mock('@react-navigation/native', () => ({
|
|
10
10
|
...jest.requireActual('@react-navigation/native'),
|
|
11
11
|
useNavigation: () => mockNavigation,
|
|
@@ -15,9 +15,20 @@ jest.mock('@react-navigation/elements', () => ({
|
|
|
15
15
|
useHeaderHeight: () => 0,
|
|
16
16
|
}))
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
let mockConversation = { type: 'Conversation', id: 7, title: 'Youth Group' } as ConversationResource
|
|
19
|
+
const mockSetMuted = jest.fn()
|
|
19
20
|
jest.mock('../../hooks/use_conversation', () => ({
|
|
20
|
-
useConversation: () => ({ data:
|
|
21
|
+
useConversation: () => ({ data: mockConversation }),
|
|
22
|
+
useConversationMute: () => ({ muted: false, setMuted: mockSetMuted, isPending: false }),
|
|
23
|
+
}))
|
|
24
|
+
|
|
25
|
+
const mockMarkRead = jest.fn()
|
|
26
|
+
jest.mock('../../hooks/use_conversations_actions', () => ({
|
|
27
|
+
useConversationsMarkRead: () => ({ read: true, markRead: mockMarkRead, isPending: false }),
|
|
28
|
+
}))
|
|
29
|
+
jest.mock('../../components/display', () => ({
|
|
30
|
+
...jest.requireActual('../../components/display'),
|
|
31
|
+
ConversationAvatar: () => null,
|
|
21
32
|
}))
|
|
22
33
|
|
|
23
34
|
let mockHidden = false
|
|
@@ -36,11 +47,11 @@ const safeAreaMetrics = {
|
|
|
36
47
|
insets: { top: 0, right: 0, bottom: 0, left: 0 },
|
|
37
48
|
}
|
|
38
49
|
|
|
39
|
-
const renderScreen = () =>
|
|
50
|
+
const renderScreen = (params: { read?: boolean; muted?: boolean } = {}) =>
|
|
40
51
|
render(
|
|
41
52
|
<SafeAreaProvider initialMetrics={safeAreaMetrics}>
|
|
42
53
|
<ThemeProvider value={DefaultTheme}>
|
|
43
|
-
<ConversationActionsScreen route={{ params: { conversation_id: 7 } }} />
|
|
54
|
+
<ConversationActionsScreen route={{ params: { conversation_id: 7, ...params } }} />
|
|
44
55
|
</ThemeProvider>
|
|
45
56
|
</SafeAreaProvider>
|
|
46
57
|
)
|
|
@@ -49,6 +60,7 @@ describe('ConversationActionsScreen', () => {
|
|
|
49
60
|
beforeEach(() => {
|
|
50
61
|
mockHidden = false
|
|
51
62
|
mockHideEnabled = true
|
|
63
|
+
mockConversation = { type: 'Conversation', id: 7, title: 'Youth Group' } as ConversationResource
|
|
52
64
|
jest.clearAllMocks()
|
|
53
65
|
})
|
|
54
66
|
|
|
@@ -57,6 +69,17 @@ describe('ConversationActionsScreen', () => {
|
|
|
57
69
|
const { queryByText } = renderScreen()
|
|
58
70
|
|
|
59
71
|
expect(queryByText('Hide conversation')).toBeNull()
|
|
72
|
+
expect(queryByText('Select conversations')).toBeNull()
|
|
73
|
+
})
|
|
74
|
+
|
|
75
|
+
it('asks the conversation list to enter select mode with this conversation', () => {
|
|
76
|
+
const { getByText } = renderScreen()
|
|
77
|
+
|
|
78
|
+
fireEvent.press(getByText('Select conversations'))
|
|
79
|
+
|
|
80
|
+
expect(mockNavigation.dispatch).toHaveBeenCalledWith(
|
|
81
|
+
StackActions.popTo('Conversations', { select_conversation_id: 7 }, { merge: true })
|
|
82
|
+
)
|
|
60
83
|
})
|
|
61
84
|
|
|
62
85
|
it('hides the conversation and closes the sheet', () => {
|
|
@@ -76,4 +99,23 @@ describe('ConversationActionsScreen', () => {
|
|
|
76
99
|
|
|
77
100
|
expect(mockSetHidden).toHaveBeenCalledWith(false)
|
|
78
101
|
})
|
|
102
|
+
|
|
103
|
+
it('toggles read and silenced from the state the list row passed in', () => {
|
|
104
|
+
const { getByText } = renderScreen({ read: false, muted: true })
|
|
105
|
+
|
|
106
|
+
fireEvent.press(getByText('Mark as read'))
|
|
107
|
+
fireEvent.press(getByText('Enable'))
|
|
108
|
+
|
|
109
|
+
expect(mockMarkRead).toHaveBeenCalledWith(true)
|
|
110
|
+
expect(mockSetMuted).toHaveBeenCalledWith(false)
|
|
111
|
+
})
|
|
112
|
+
|
|
113
|
+
it('offers neither silence nor hide on an archived conversation', () => {
|
|
114
|
+
mockConversation = { ...mockConversation, disabled: true, disabledReason: 'archived' }
|
|
115
|
+
const { queryByText, getByText } = renderScreen()
|
|
116
|
+
|
|
117
|
+
expect(queryByText('Silence')).toBeNull()
|
|
118
|
+
expect(queryByText('Hide conversation')).toBeNull()
|
|
119
|
+
expect(getByText('Select conversations')).toBeTruthy()
|
|
120
|
+
})
|
|
79
121
|
})
|
|
@@ -257,16 +257,6 @@ describe('ConversationDetailsScreen archive', () => {
|
|
|
257
257
|
expect(queryByText('Archive conversation…')).toBeNull()
|
|
258
258
|
})
|
|
259
259
|
|
|
260
|
-
it.each(['QA_MOBILE_manual_archiving', 'ROLLOUT_MOBILE_manual_archiving'])(
|
|
261
|
-
'offers archiving with only %s on',
|
|
262
|
-
flag => {
|
|
263
|
-
mockEnabledFeatures = [flag]
|
|
264
|
-
const { getByText } = renderScreen()
|
|
265
|
-
|
|
266
|
-
expect(getByText('Archive conversation…')).toBeTruthy()
|
|
267
|
-
}
|
|
268
|
-
)
|
|
269
|
-
|
|
270
260
|
it('hides archiving when neither mobile flag is on', () => {
|
|
271
261
|
mockEnabledFeatures = ['ROLLOUT_WEB_manual_archiving']
|
|
272
262
|
const { queryByText } = renderScreen()
|
|
@@ -299,15 +289,6 @@ describe('ConversationDetailsScreen archive', () => {
|
|
|
299
289
|
expect(mockNavigation.goBack).not.toHaveBeenCalled()
|
|
300
290
|
expect(mockNavigation.navigate).not.toHaveBeenCalled()
|
|
301
291
|
})
|
|
302
|
-
|
|
303
|
-
it('does nothing when the confirmation is cancelled', () => {
|
|
304
|
-
const { getByText } = renderScreen()
|
|
305
|
-
fireEvent.press(getByText('Archive conversation…'))
|
|
306
|
-
|
|
307
|
-
alertButton('Cancel')?.onPress?.()
|
|
308
|
-
|
|
309
|
-
expect(mockArchive).not.toHaveBeenCalled()
|
|
310
|
-
})
|
|
311
292
|
})
|
|
312
293
|
|
|
313
294
|
describe('ConversationDetailsScreen hide', () => {
|
|
@@ -10,20 +10,6 @@ import {
|
|
|
10
10
|
|
|
11
11
|
const emptyState = initEmptyAvatarPickerState()
|
|
12
12
|
|
|
13
|
-
describe('initEmptyAvatarPickerState', () => {
|
|
14
|
-
it('starts clean', () => {
|
|
15
|
-
expect(emptyState).toMatchObject({
|
|
16
|
-
activeTab: 'icon',
|
|
17
|
-
selectedType: null,
|
|
18
|
-
selectedKey: null,
|
|
19
|
-
selectedColor: DEFAULT_AVATAR_COLOR_KEY,
|
|
20
|
-
imagePreviewUri: null,
|
|
21
|
-
imageAsset: null,
|
|
22
|
-
isDirty: false,
|
|
23
|
-
})
|
|
24
|
-
})
|
|
25
|
-
})
|
|
26
|
-
|
|
27
13
|
describe('initAvatarPickerState', () => {
|
|
28
14
|
it('seeds from icon avatar', () => {
|
|
29
15
|
const conversation = {
|
|
@@ -1,39 +1,150 @@
|
|
|
1
|
-
import { StaticScreenProps, useNavigation } from '@react-navigation/native'
|
|
1
|
+
import { StackActions, StaticScreenProps, useNavigation } from '@react-navigation/native'
|
|
2
2
|
import React from 'react'
|
|
3
|
-
import { StyleSheet } from 'react-native'
|
|
3
|
+
import { StyleSheet, View } from 'react-native'
|
|
4
|
+
import { ConversationAvatar, Heading, Text } from '../components/display'
|
|
4
5
|
import FormSheet, { getFormSheetScreenOptions } from '../components/primitive/form_sheet'
|
|
5
|
-
import {
|
|
6
|
+
import { useTheme } from '../hooks'
|
|
7
|
+
import { useConversation, useConversationMute } from '../hooks/use_conversation'
|
|
8
|
+
import { useConversationsMarkRead } from '../hooks/use_conversations_actions'
|
|
6
9
|
import { useHideConversation } from '../hooks/use_hide_conversation'
|
|
7
10
|
import { useHideConversationsEnabled } from '../hooks/use_hide_conversations_enabled'
|
|
11
|
+
import { isArchivedConversation, MAX_FONT_SIZE_MULTIPLIER_LANDMARK } from '../utils'
|
|
8
12
|
|
|
9
13
|
export const ConversationActionsScreenOptions = getFormSheetScreenOptions({
|
|
10
14
|
headerTitle: 'Conversation actions',
|
|
15
|
+
sheetAllowedDetents: 'fitToContents',
|
|
11
16
|
})
|
|
12
17
|
|
|
13
18
|
export type ConversationActionsScreenProps = StaticScreenProps<{
|
|
14
19
|
conversation_id: number
|
|
20
|
+
read?: boolean
|
|
21
|
+
muted?: boolean
|
|
15
22
|
}>
|
|
16
23
|
|
|
17
24
|
export function ConversationActionsScreen({ route }: ConversationActionsScreenProps) {
|
|
18
25
|
const navigation = useNavigation()
|
|
19
26
|
const styles = useStyles()
|
|
20
|
-
const {
|
|
21
|
-
const {
|
|
27
|
+
const { conversation_id } = route.params
|
|
28
|
+
const { data: conversation } = useConversation({ conversation_id })
|
|
29
|
+
const { hidden, setHidden, isPending: isHiddenPending } = useHideConversation({ conversation })
|
|
30
|
+
const markReadState = useConversationsMarkRead({ conversation })
|
|
31
|
+
const muteState = useConversationMute({ conversation_id })
|
|
22
32
|
const hideConversationsEnabled = useHideConversationsEnabled()
|
|
23
33
|
|
|
34
|
+
const read = route.params.read ?? markReadState.read
|
|
35
|
+
const muted = route.params.muted ?? muteState.muted
|
|
36
|
+
const archived = isArchivedConversation(conversation)
|
|
37
|
+
const emptyConversation = conversation.lastMessageCreatedAt === null
|
|
38
|
+
const subtitle = conversation.badges?.[0]?.text
|
|
39
|
+
|
|
40
|
+
const navigateAfterDismiss = (navigate: () => void) => {
|
|
41
|
+
navigation.goBack()
|
|
42
|
+
requestAnimationFrame(navigate)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const handleOpenPress = () =>
|
|
46
|
+
navigateAfterDismiss(() =>
|
|
47
|
+
navigation.navigate('Conversation', {
|
|
48
|
+
conversation_id,
|
|
49
|
+
title: conversation.title ?? undefined,
|
|
50
|
+
badge: conversation.badges?.[0],
|
|
51
|
+
deleted: conversation.deleted,
|
|
52
|
+
muted,
|
|
53
|
+
})
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
const handleDetailsPress = () =>
|
|
57
|
+
navigateAfterDismiss(() => navigation.navigate('ConversationDetails', { conversation_id }))
|
|
58
|
+
|
|
59
|
+
const handleMarkReadPress = () => {
|
|
60
|
+
markReadState.markRead(!read)
|
|
61
|
+
navigation.goBack()
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const handleMutePress = () => {
|
|
65
|
+
muteState.setMuted(!muted)
|
|
66
|
+
navigation.goBack()
|
|
67
|
+
}
|
|
68
|
+
|
|
24
69
|
const handleHidePress = () => {
|
|
25
70
|
setHidden(!hidden)
|
|
26
71
|
navigation.goBack()
|
|
27
72
|
}
|
|
28
73
|
|
|
74
|
+
const handleSelectPress = () => {
|
|
75
|
+
navigation.dispatch(
|
|
76
|
+
StackActions.popTo(
|
|
77
|
+
'Conversations',
|
|
78
|
+
{ select_conversation_id: conversation_id },
|
|
79
|
+
{ merge: true }
|
|
80
|
+
)
|
|
81
|
+
)
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
if (!hideConversationsEnabled) return <FormSheet.Root fitToContents>{null}</FormSheet.Root>
|
|
85
|
+
|
|
29
86
|
return (
|
|
30
|
-
<FormSheet.Root
|
|
31
|
-
|
|
87
|
+
<FormSheet.Root fitToContents>
|
|
88
|
+
<FormSheet.Header>
|
|
89
|
+
<View style={styles.header}>
|
|
90
|
+
<ConversationAvatar conversation={conversation} size="md" showFallback />
|
|
91
|
+
<View style={styles.headerText}>
|
|
92
|
+
<Heading
|
|
93
|
+
variant="h3"
|
|
94
|
+
numberOfLines={1}
|
|
95
|
+
maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER_LANDMARK}
|
|
96
|
+
>
|
|
97
|
+
{conversation.title}
|
|
98
|
+
</Heading>
|
|
99
|
+
{!!subtitle && (
|
|
100
|
+
<Text
|
|
101
|
+
variant="tertiary"
|
|
102
|
+
numberOfLines={1}
|
|
103
|
+
maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER_LANDMARK}
|
|
104
|
+
>
|
|
105
|
+
{subtitle}
|
|
106
|
+
</Text>
|
|
107
|
+
)}
|
|
108
|
+
</View>
|
|
109
|
+
</View>
|
|
110
|
+
</FormSheet.Header>
|
|
111
|
+
<FormSheet.Action
|
|
112
|
+
onPress={handleOpenPress}
|
|
113
|
+
title="Open conversation"
|
|
114
|
+
iconName="general.textMessage"
|
|
115
|
+
/>
|
|
116
|
+
<FormSheet.Action
|
|
117
|
+
onPress={handleDetailsPress}
|
|
118
|
+
title="Conversation details"
|
|
119
|
+
iconName="general.cog"
|
|
120
|
+
/>
|
|
121
|
+
{!emptyConversation && (
|
|
122
|
+
<FormSheet.Action
|
|
123
|
+
onPress={handleMarkReadPress}
|
|
124
|
+
title={read ? 'Mark as unread' : 'Mark as read'}
|
|
125
|
+
iconName={read ? 'checkIns.checkPending' : 'checkIns.check'}
|
|
126
|
+
disabled={markReadState.isPending}
|
|
127
|
+
/>
|
|
128
|
+
)}
|
|
129
|
+
{!archived && (
|
|
130
|
+
<FormSheet.Action
|
|
131
|
+
onPress={handleMutePress}
|
|
132
|
+
title={muted ? 'Enable' : 'Silence'}
|
|
133
|
+
iconName={muted ? 'general.bell' : 'general.bellMuted'}
|
|
134
|
+
disabled={muteState.isPending}
|
|
135
|
+
accessibilityHint={
|
|
136
|
+
muted
|
|
137
|
+
? 'Turns notifications for this conversation back on.'
|
|
138
|
+
: 'Turns off notifications for this conversation.'
|
|
139
|
+
}
|
|
140
|
+
/>
|
|
141
|
+
)}
|
|
142
|
+
{!archived && (
|
|
32
143
|
<FormSheet.Action
|
|
33
144
|
onPress={handleHidePress}
|
|
34
145
|
title={hidden ? 'Unhide conversation' : 'Hide conversation'}
|
|
35
146
|
iconName={hidden ? 'general.showEye' : 'general.hideEye'}
|
|
36
|
-
disabled={
|
|
147
|
+
disabled={isHiddenPending}
|
|
37
148
|
accessibilityHint={
|
|
38
149
|
hidden
|
|
39
150
|
? 'Shows this conversation in your conversation list again.'
|
|
@@ -41,13 +152,35 @@ export function ConversationActionsScreen({ route }: ConversationActionsScreenPr
|
|
|
41
152
|
}
|
|
42
153
|
/>
|
|
43
154
|
)}
|
|
155
|
+
<View style={styles.divider} />
|
|
156
|
+
<FormSheet.Action
|
|
157
|
+
onPress={handleSelectPress}
|
|
158
|
+
title="Select conversations"
|
|
159
|
+
iconName="general.check"
|
|
160
|
+
accessibilityHint="Selects this conversation and lets you choose more to hide, silence, or mark read."
|
|
161
|
+
/>
|
|
44
162
|
</FormSheet.Root>
|
|
45
163
|
)
|
|
46
164
|
}
|
|
47
165
|
|
|
48
|
-
const useStyles = () =>
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
166
|
+
const useStyles = () => {
|
|
167
|
+
const { colors } = useTheme()
|
|
168
|
+
|
|
169
|
+
return StyleSheet.create({
|
|
170
|
+
header: {
|
|
171
|
+
flex: 1,
|
|
172
|
+
flexDirection: 'row',
|
|
173
|
+
alignItems: 'center',
|
|
174
|
+
gap: 12,
|
|
175
|
+
},
|
|
176
|
+
headerText: {
|
|
177
|
+
flex: 1,
|
|
178
|
+
},
|
|
179
|
+
divider: {
|
|
180
|
+
height: 1,
|
|
181
|
+
marginHorizontal: 16,
|
|
182
|
+
marginVertical: 4,
|
|
183
|
+
backgroundColor: colors.borderColorDefaultBase,
|
|
52
184
|
},
|
|
53
185
|
})
|
|
186
|
+
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { type RouteProp, useRoute } from '@react-navigation/native'
|
|
2
|
-
import { Pressable,
|
|
3
|
-
import {
|
|
2
|
+
import { Pressable, StyleSheet, type ViewStyle } from 'react-native'
|
|
3
|
+
import { Checkbox, Text } from '../../../components'
|
|
4
4
|
import { useTheme } from '../../../hooks'
|
|
5
|
-
import { tokens } from '../../../vendor/tapestry/tokens'
|
|
6
5
|
import { ConversationFilterRecipientsScreenProps, SetTeamFilters, TeamProps } from '../types'
|
|
7
6
|
|
|
8
7
|
interface TeamRowProps {
|
|
@@ -43,7 +42,7 @@ export const CheckboxRow = ({
|
|
|
43
42
|
accessibilityLabelledBy={accessibilityLabelledBy}
|
|
44
43
|
accessibilityLabel={`${teamName} team`}
|
|
45
44
|
>
|
|
46
|
-
<
|
|
45
|
+
<Checkbox checked={checked} />
|
|
47
46
|
<Text style={styles.label} numberOfLines={2}>
|
|
48
47
|
{teamName}
|
|
49
48
|
</Text>
|
|
@@ -51,28 +50,9 @@ export const CheckboxRow = ({
|
|
|
51
50
|
)
|
|
52
51
|
}
|
|
53
52
|
|
|
54
|
-
function CheckboxIcon({ checked }: { checked: boolean }) {
|
|
55
|
-
const styles = useStyles()
|
|
56
|
-
const checkedStyle = checked ? styles.checkedContainer : styles.uncheckedContainer
|
|
57
|
-
|
|
58
|
-
return (
|
|
59
|
-
<View style={checkedStyle}>
|
|
60
|
-
{checked && <Icon name="general.thickCheckmark" style={styles.checkedIcon} />}
|
|
61
|
-
</View>
|
|
62
|
-
)
|
|
63
|
-
}
|
|
64
|
-
|
|
65
53
|
const useStyles = () => {
|
|
66
54
|
const { colors } = useTheme()
|
|
67
55
|
|
|
68
|
-
const baseCheckboxStyles: ViewStyle = {
|
|
69
|
-
width: 20,
|
|
70
|
-
height: 20,
|
|
71
|
-
borderRadius: 40,
|
|
72
|
-
alignItems: 'center',
|
|
73
|
-
justifyContent: 'center',
|
|
74
|
-
}
|
|
75
|
-
|
|
76
56
|
return StyleSheet.create({
|
|
77
57
|
checkboxRow: {
|
|
78
58
|
flexDirection: 'row',
|
|
@@ -89,17 +69,5 @@ const useStyles = () => {
|
|
|
89
69
|
label: {
|
|
90
70
|
flex: 1,
|
|
91
71
|
},
|
|
92
|
-
checkedContainer: {
|
|
93
|
-
...baseCheckboxStyles,
|
|
94
|
-
backgroundColor: colors.statusSuccessIcon,
|
|
95
|
-
},
|
|
96
|
-
uncheckedContainer: {
|
|
97
|
-
...baseCheckboxStyles,
|
|
98
|
-
borderWidth: 2,
|
|
99
|
-
borderColor: colors.borderColorDefaultDarker,
|
|
100
|
-
},
|
|
101
|
-
checkedIcon: {
|
|
102
|
-
color: tokens.colorNeutral100White,
|
|
103
|
-
},
|
|
104
72
|
})
|
|
105
73
|
}
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
useGroupMembersForNewConversation,
|
|
13
13
|
} from '../../../hooks/groups/use_group_members_for_new_conversation'
|
|
14
14
|
import { useGroupsConversationCreate } from '../../../hooks/groups/use_groups_conversation_create'
|
|
15
|
+
import { useGroupsProxy } from '../../../hooks/groups/use_groups_proxy'
|
|
15
16
|
import {
|
|
16
17
|
type AvatarUpdatePayload,
|
|
17
18
|
patchConversationAvatar,
|
|
@@ -50,15 +51,16 @@ export const GroupsForm = ({ groupId, chat_group_graph_id, avatarSelection }: Gr
|
|
|
50
51
|
genderValue,
|
|
51
52
|
isFetching: genderFetching,
|
|
52
53
|
} = useMyGender()
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
54
|
+
const groupsProxied = useGroupsProxy()
|
|
55
|
+
const { data: group } = useSuspenseGet<GroupsGroupResource>(
|
|
56
|
+
groupsProxied
|
|
57
|
+
? {
|
|
58
|
+
url: `/me/groups_groups/${groupId}`,
|
|
59
|
+
data: { fields: { GroupsGroup: ['name', 'memberships_count'] } },
|
|
60
|
+
app: 'chat',
|
|
61
|
+
}
|
|
62
|
+
: { url: `/me/groups/${groupId}`, data: { fields: { Group: [] } }, app: 'groups' }
|
|
63
|
+
)
|
|
62
64
|
|
|
63
65
|
const activeGenderId = genderFilterEnabled ? genderId : null
|
|
64
66
|
const activeGenderValue = genderFilterEnabled ? genderValue : null
|
|
@@ -9,9 +9,15 @@ import {
|
|
|
9
9
|
ImagePickerAdapter,
|
|
10
10
|
VideoAdapter,
|
|
11
11
|
} from '../../../utils/native_adapters'
|
|
12
|
-
import { ConversationsScreen } from '../conversations_screen'
|
|
12
|
+
import { ConversationsScreen, ConversationsScreenProps } from '../conversations_screen'
|
|
13
13
|
|
|
14
14
|
const mockGet = jest.fn()
|
|
15
|
+
const mockSetParams = jest.fn()
|
|
16
|
+
const mockEnterSelectMode = jest.fn()
|
|
17
|
+
jest.mock('@react-navigation/native', () => ({
|
|
18
|
+
...jest.requireActual('@react-navigation/native'),
|
|
19
|
+
useNavigation: () => ({ setOptions: jest.fn(), goBack: jest.fn(), setParams: mockSetParams }),
|
|
20
|
+
}))
|
|
15
21
|
jest.mock('../../../hooks/use_api_client', () => ({
|
|
16
22
|
useApiClient: () => ({ chat: { get: mockGet } }),
|
|
17
23
|
}))
|
|
@@ -21,6 +27,11 @@ jest.mock('../../../hooks/use_product_analytics', () => ({
|
|
|
21
27
|
}))
|
|
22
28
|
jest.mock('../../../contexts/conversations_context', () => ({
|
|
23
29
|
ConversationsContextProvider: ({ children }: { children: React.ReactNode }) => children,
|
|
30
|
+
useConversationsContext: () => ({
|
|
31
|
+
selectMode: false,
|
|
32
|
+
selectedIds: [],
|
|
33
|
+
enterSelectMode: mockEnterSelectMode,
|
|
34
|
+
}),
|
|
24
35
|
}))
|
|
25
36
|
jest.mock('../../../components', () => ({
|
|
26
37
|
Conversations: ({ ListHeaderComponent }: { ListHeaderComponent: React.ComponentType }) => (
|
|
@@ -28,6 +39,9 @@ jest.mock('../../../components', () => ({
|
|
|
28
39
|
),
|
|
29
40
|
}))
|
|
30
41
|
jest.mock('../../../components/display/toast', () => ({ Toast: () => null }))
|
|
42
|
+
jest.mock('../../../components/conversations/bulk_conversation_actions_bar', () => ({
|
|
43
|
+
BulkConversationActionsBar: () => null,
|
|
44
|
+
}))
|
|
31
45
|
jest.mock('../components/list_header_component', () => {
|
|
32
46
|
const { Text } = require('react-native')
|
|
33
47
|
return { ListHeaderComponent: () => <Text>Default header</Text> }
|
|
@@ -56,7 +70,10 @@ const configureAdapters = () => {
|
|
|
56
70
|
})
|
|
57
71
|
}
|
|
58
72
|
|
|
59
|
-
const renderWithFeatures = (
|
|
73
|
+
const renderWithFeatures = (
|
|
74
|
+
enabledFeatures: string[],
|
|
75
|
+
params: ConversationsScreenProps['route']['params'] = {}
|
|
76
|
+
) => {
|
|
60
77
|
mockGet.mockResolvedValue({
|
|
61
78
|
data: enabledFeatures.map((name, index) => ({
|
|
62
79
|
type: 'Feature',
|
|
@@ -71,7 +88,7 @@ const renderWithFeatures = (enabledFeatures: string[]) => {
|
|
|
71
88
|
return render(
|
|
72
89
|
<QueryClientProvider client={buildTestQueryClient()}>
|
|
73
90
|
<Suspense fallback={null}>
|
|
74
|
-
<ConversationsScreen route={{ params
|
|
91
|
+
<ConversationsScreen route={{ params }} />
|
|
75
92
|
</Suspense>
|
|
76
93
|
</QueryClientProvider>
|
|
77
94
|
)
|
|
@@ -100,15 +117,24 @@ describe('ConversationsScreen header gating', () => {
|
|
|
100
117
|
expect(await view.findByText('Filter dropdown header')).toBeTruthy()
|
|
101
118
|
})
|
|
102
119
|
|
|
103
|
-
it('shows the filter dropdown header with only its rollout flag on', async () => {
|
|
104
|
-
const view = renderWithFeatures(['ROLLOUT_MOBILE_filter_dropdown'])
|
|
105
|
-
|
|
106
|
-
expect(await view.findByText('Filter dropdown header')).toBeTruthy()
|
|
107
|
-
})
|
|
108
|
-
|
|
109
120
|
it('shows the default header with neither flag on', async () => {
|
|
110
121
|
const view = renderWithFeatures(['ROLLOUT_WEB_search'])
|
|
111
122
|
|
|
112
123
|
expect(await view.findByText('Default header')).toBeTruthy()
|
|
113
124
|
})
|
|
114
125
|
})
|
|
126
|
+
|
|
127
|
+
describe('ConversationsScreen select mode request', () => {
|
|
128
|
+
beforeEach(() => {
|
|
129
|
+
configureAdapters()
|
|
130
|
+
jest.clearAllMocks()
|
|
131
|
+
})
|
|
132
|
+
|
|
133
|
+
it('enters select mode for the requested conversation and consumes the request', async () => {
|
|
134
|
+
const view = renderWithFeatures([], { select_conversation_id: 7 })
|
|
135
|
+
await view.findByText('Default header')
|
|
136
|
+
|
|
137
|
+
expect(mockEnterSelectMode).toHaveBeenCalledWith(7)
|
|
138
|
+
expect(mockSetParams).toHaveBeenCalledWith({ select_conversation_id: undefined })
|
|
139
|
+
})
|
|
140
|
+
})
|
|
@@ -326,14 +326,6 @@ describe('FilterDropdownListHeaderComponent', () => {
|
|
|
326
326
|
)
|
|
327
327
|
})
|
|
328
328
|
|
|
329
|
-
it('More filters opens the filters sheet', () => {
|
|
330
|
-
render(<FilterDropdownListHeaderComponent />)
|
|
331
|
-
|
|
332
|
-
fireEvent.press(screen.getByRole('menuitem', { name: 'More filters' }))
|
|
333
|
-
|
|
334
|
-
expect(mockNavigate).toHaveBeenCalledWith('ConversationFilters', expect.any(Object))
|
|
335
|
-
})
|
|
336
|
-
|
|
337
329
|
it('More filters carries the Unread filter into the sheet', () => {
|
|
338
330
|
setRouteParams({ show_unread: true })
|
|
339
331
|
|
package/src/screens/conversations/components/__tests__/search_list_header_component.test.tsx
CHANGED
|
@@ -49,14 +49,4 @@ describe('SearchListHeaderComponent search button', () => {
|
|
|
49
49
|
expect(mockNavigate).toHaveBeenCalledTimes(1)
|
|
50
50
|
expect(mockNavigate).toHaveBeenCalledWith('Search')
|
|
51
51
|
})
|
|
52
|
-
|
|
53
|
-
it('renders the search button after the other actions', () => {
|
|
54
|
-
const view = render(<SearchListHeaderComponent />)
|
|
55
|
-
|
|
56
|
-
const buttons = view.getAllByRole('button').map(button => button.props.accessibilityLabel)
|
|
57
|
-
|
|
58
|
-
expect(buttons.indexOf('Search')).toBeGreaterThanOrEqual(0)
|
|
59
|
-
expect(buttons.indexOf('Search')).toBeGreaterThan(buttons.indexOf('Chat settings'))
|
|
60
|
-
expect(buttons.indexOf('Search')).toBeGreaterThan(buttons.indexOf('New conversation'))
|
|
61
|
-
})
|
|
62
52
|
})
|