@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
|
@@ -41,29 +41,4 @@ describe('useFontScale', () => {
|
|
|
41
41
|
expect(result.current).toBe(2)
|
|
42
42
|
})
|
|
43
43
|
})
|
|
44
|
-
|
|
45
|
-
describe('with both constraints', () => {
|
|
46
|
-
test('returns native scale when within bounds', () => {
|
|
47
|
-
const { result } = renderHook(() =>
|
|
48
|
-
useFontScale({ minFontSizeMultiplier: 0.5, maxFontSizeMultiplier: 2 })
|
|
49
|
-
)
|
|
50
|
-
expect(result.current).toBe(DEFAULT_NATIVE_FONT_SCALE)
|
|
51
|
-
})
|
|
52
|
-
|
|
53
|
-
test('clamps to minimum when native scale is below', () => {
|
|
54
|
-
mockUseWindowDimensions.mockReturnValue({ fontScale: SMALL_NATIVE_FONT_SCALE })
|
|
55
|
-
const { result } = renderHook(() =>
|
|
56
|
-
useFontScale({ minFontSizeMultiplier: 1, maxFontSizeMultiplier: 2 })
|
|
57
|
-
)
|
|
58
|
-
expect(result.current).toBe(1)
|
|
59
|
-
})
|
|
60
|
-
|
|
61
|
-
test('clamps to maximum when native scale exceeds', () => {
|
|
62
|
-
mockUseWindowDimensions.mockReturnValue({ fontScale: LARGE_NATIVE_FONT_SCALE })
|
|
63
|
-
const { result } = renderHook(() =>
|
|
64
|
-
useFontScale({ minFontSizeMultiplier: 1, maxFontSizeMultiplier: 2 })
|
|
65
|
-
)
|
|
66
|
-
expect(result.current).toBe(2)
|
|
67
|
-
})
|
|
68
|
-
})
|
|
69
44
|
})
|
|
@@ -5,6 +5,11 @@ import { buildTestQueryClient } from '../../__utils__/query_client'
|
|
|
5
5
|
import { useGroupChatConversationPayload } from '../../hooks/groups/use_group_chat_conversation_payload'
|
|
6
6
|
import * as useApiClientModule from '../../hooks/use_api_client'
|
|
7
7
|
|
|
8
|
+
const mockGroupsProxy = jest.fn(() => false)
|
|
9
|
+
jest.mock('../../hooks/groups/use_groups_proxy', () => ({
|
|
10
|
+
useGroupsProxy: () => mockGroupsProxy(),
|
|
11
|
+
}))
|
|
12
|
+
|
|
8
13
|
const mockGroupsPost = (impl: jest.Mock) => {
|
|
9
14
|
jest.spyOn(useApiClientModule, 'useApiClient').mockReturnValue({
|
|
10
15
|
groups: { post: impl },
|
|
@@ -22,6 +27,7 @@ const resolveWith = (value: string) =>
|
|
|
22
27
|
describe('useGroupChatConversationPayload', () => {
|
|
23
28
|
afterEach(() => {
|
|
24
29
|
jest.restoreAllMocks()
|
|
30
|
+
mockGroupsProxy.mockReturnValue(false)
|
|
25
31
|
})
|
|
26
32
|
|
|
27
33
|
it('refetches on mount even when a fresh payload is already cached', async () => {
|
|
@@ -47,4 +53,29 @@ describe('useGroupChatConversationPayload', () => {
|
|
|
47
53
|
await waitFor(() => expect(post).toHaveBeenCalledTimes(1))
|
|
48
54
|
await waitFor(() => expect(result.current.payload).toBe('fresh'))
|
|
49
55
|
})
|
|
56
|
+
|
|
57
|
+
it('asks Chat for the payload when Groups loads through Chat', async () => {
|
|
58
|
+
mockGroupsProxy.mockReturnValue(true)
|
|
59
|
+
const post = resolveWith('proxied')
|
|
60
|
+
const groupsPost = jest.fn()
|
|
61
|
+
jest.spyOn(useApiClientModule, 'useApiClient').mockReturnValue({
|
|
62
|
+
chat: { post },
|
|
63
|
+
groups: { post: groupsPost },
|
|
64
|
+
} as unknown as ReturnType<typeof useApiClientModule.useApiClient>)
|
|
65
|
+
const queryClient = buildTestQueryClient()
|
|
66
|
+
const wrapper = ({ children }: { children: React.ReactNode }) => (
|
|
67
|
+
<QueryClientProvider client={queryClient}>{children}</QueryClientProvider>
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
const { result } = renderHook(() => useGroupChatConversationPayload({ groupId: 1 }), {
|
|
71
|
+
wrapper,
|
|
72
|
+
})
|
|
73
|
+
|
|
74
|
+
await waitFor(() => expect(result.current.payload).toBe('proxied'))
|
|
75
|
+
expect(post).toHaveBeenCalledWith({
|
|
76
|
+
url: '/me/groups_groups/1/chat_conversation_payload',
|
|
77
|
+
data: { data: { type: 'GroupsChatConversationPayload', attributes: { title: '' } } },
|
|
78
|
+
})
|
|
79
|
+
expect(groupsPost).not.toHaveBeenCalled()
|
|
80
|
+
})
|
|
50
81
|
})
|
|
@@ -127,75 +127,8 @@ describe('updateOrCreateRecordInPagesData', () => {
|
|
|
127
127
|
],
|
|
128
128
|
})
|
|
129
129
|
})
|
|
130
|
-
})
|
|
131
|
-
|
|
132
|
-
describe('updateOrCreateRecordInPagesData function', () => {
|
|
133
|
-
it('should update the record in the pages data', () => {
|
|
134
|
-
const id = '3'
|
|
135
|
-
const record = createRecord({ id })
|
|
136
|
-
const result = updateOrCreateRecordInPagesData({ data, record })
|
|
137
|
-
|
|
138
|
-
expect(result).toEqual({
|
|
139
|
-
pageParams: {},
|
|
140
|
-
pages: [
|
|
141
|
-
{
|
|
142
|
-
data: [
|
|
143
|
-
{ id: '1', type: 'Message', text: 'message 1' },
|
|
144
|
-
{ id: '2', type: 'Message', text: 'message 2' },
|
|
145
|
-
],
|
|
146
|
-
included: [],
|
|
147
|
-
links: {},
|
|
148
|
-
meta: { count: 2, totalCount: 2 },
|
|
149
|
-
},
|
|
150
|
-
{
|
|
151
|
-
data: [
|
|
152
|
-
{ id: '3', type: 'Message', text: 'example 3' },
|
|
153
|
-
{ id: '4', type: 'Message', text: 'message 4' },
|
|
154
|
-
],
|
|
155
|
-
included: [],
|
|
156
|
-
links: {},
|
|
157
|
-
meta: { count: 2, totalCount: 2 },
|
|
158
|
-
},
|
|
159
|
-
],
|
|
160
|
-
})
|
|
161
|
-
})
|
|
162
130
|
|
|
163
|
-
it('should
|
|
164
|
-
const id = '2'
|
|
165
|
-
const record = createRecord({ id })
|
|
166
|
-
|
|
167
|
-
const result = updateOrCreateRecordInPagesData<typeof record>({
|
|
168
|
-
data,
|
|
169
|
-
record,
|
|
170
|
-
processRecord: r => ({ ...r, text: 'updated ' + r.text }),
|
|
171
|
-
})
|
|
172
|
-
|
|
173
|
-
expect(result).toEqual({
|
|
174
|
-
pageParams: {},
|
|
175
|
-
pages: [
|
|
176
|
-
{
|
|
177
|
-
data: [
|
|
178
|
-
{ id: '1', type: 'Message', text: 'message 1' },
|
|
179
|
-
{ id, type: 'Message', text: `updated example ${id}` },
|
|
180
|
-
],
|
|
181
|
-
included: [],
|
|
182
|
-
links: {},
|
|
183
|
-
meta: { count: 2, totalCount: 2 },
|
|
184
|
-
},
|
|
185
|
-
{
|
|
186
|
-
data: [
|
|
187
|
-
{ id: '3', type: 'Message', text: 'message 3' },
|
|
188
|
-
{ id: '4', type: 'Message', text: 'message 4' },
|
|
189
|
-
],
|
|
190
|
-
included: [],
|
|
191
|
-
links: {},
|
|
192
|
-
meta: { count: 2, totalCount: 2 },
|
|
193
|
-
},
|
|
194
|
-
],
|
|
195
|
-
})
|
|
196
|
-
})
|
|
197
|
-
|
|
198
|
-
it('should add records that do not yet exist, but does not run processRecord', () => {
|
|
131
|
+
it('should add records that do not yet exist and run processRecord on them', () => {
|
|
199
132
|
const id = '5'
|
|
200
133
|
const record = createRecord({ id })
|
|
201
134
|
|
|
@@ -230,7 +163,9 @@ describe('updateOrCreateRecordInPagesData function', () => {
|
|
|
230
163
|
],
|
|
231
164
|
})
|
|
232
165
|
})
|
|
166
|
+
})
|
|
233
167
|
|
|
168
|
+
describe('updateRecordInPagesData', () => {
|
|
234
169
|
it('should skip the record if it does not exist', () => {
|
|
235
170
|
const id = '5'
|
|
236
171
|
const record = createRecord({ id })
|
|
@@ -65,6 +65,12 @@ describe('get', () => {
|
|
|
65
65
|
})
|
|
66
66
|
|
|
67
67
|
it('respects opting out of pagination walks', async () => {
|
|
68
|
+
const nextUrl = APP_BASE_URL + '/records?fields%5BRecord%5D=id&per_page=1&offset=1'
|
|
69
|
+
|
|
70
|
+
MockServer.get(url, { ...DefaultFixtures.records(), links: { next: nextUrl } }, 200, {
|
|
71
|
+
once: true,
|
|
72
|
+
})
|
|
73
|
+
|
|
68
74
|
await client.get({
|
|
69
75
|
url,
|
|
70
76
|
data: { fields: { Record: ['id', 'name'] }, perPage: 1, walk: false },
|
|
@@ -230,9 +236,6 @@ describe('post', () => {
|
|
|
230
236
|
})
|
|
231
237
|
|
|
232
238
|
it('uses client default headers', async () => {
|
|
233
|
-
MockServer.post('https://api-staging.planningcenteronline.com/chat/v2/records/:id', {}, 200, {
|
|
234
|
-
once: true,
|
|
235
|
-
})
|
|
236
239
|
await clientWithDefaultHeaders.post({
|
|
237
240
|
url,
|
|
238
241
|
data: { fields: { Record: 'id' } },
|
|
@@ -283,9 +286,6 @@ describe('patch', () => {
|
|
|
283
286
|
})
|
|
284
287
|
|
|
285
288
|
it('uses client default headers', async () => {
|
|
286
|
-
MockServer.patch('https://api-staging.planningcenteronline.com/chat/v2/records/:id', {}, 200, {
|
|
287
|
-
once: true,
|
|
288
|
-
})
|
|
289
289
|
await clientWithDefaultHeaders.patch({
|
|
290
290
|
url,
|
|
291
291
|
data: { fields: { Record: 'id' } },
|
|
@@ -318,15 +318,6 @@ describe('delete', () => {
|
|
|
318
318
|
})
|
|
319
319
|
|
|
320
320
|
it('uses client default headers', async () => {
|
|
321
|
-
MockServer.delete(
|
|
322
|
-
'https://api-staging.planningcenteronline.com/chat/v2/records/:id',
|
|
323
|
-
undefined,
|
|
324
|
-
200,
|
|
325
|
-
{
|
|
326
|
-
once: true,
|
|
327
|
-
}
|
|
328
|
-
)
|
|
329
|
-
|
|
330
321
|
await clientWithDefaultHeaders.delete({
|
|
331
322
|
url,
|
|
332
323
|
headers: { 'X-Custom-Header': 'value!' },
|
|
@@ -54,10 +54,6 @@ describe('ChatAdapters', () => {
|
|
|
54
54
|
notificationError: jest.fn(),
|
|
55
55
|
})
|
|
56
56
|
|
|
57
|
-
it('should be defined', () => {
|
|
58
|
-
expect(ChatAdapters).toBeDefined()
|
|
59
|
-
})
|
|
60
|
-
|
|
61
57
|
it('should configure the clipboard', () => {
|
|
62
58
|
ChatAdapters.configure({
|
|
63
59
|
clipboard,
|
|
@@ -71,42 +67,30 @@ describe('ChatAdapters', () => {
|
|
|
71
67
|
})
|
|
72
68
|
|
|
73
69
|
describe('linking adapter', () => {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
ChatAdapters.configure({
|
|
77
|
-
clipboard,
|
|
78
|
-
audio,
|
|
79
|
-
video,
|
|
80
|
-
imagePicker,
|
|
81
|
-
})
|
|
82
|
-
|
|
83
|
-
expect(Linking).toBeDefined()
|
|
84
|
-
expect(Linking.openURL).toBeDefined()
|
|
85
|
-
expect(Linking.canOpenURL).toBeDefined()
|
|
86
|
-
})
|
|
70
|
+
it('opens URLs through React Native Linking by default', async () => {
|
|
71
|
+
ChatAdapters.configure({ clipboard, audio, video, imagePicker })
|
|
87
72
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
})
|
|
73
|
+
await Linking.openURL('https://www.google.com')
|
|
74
|
+
|
|
75
|
+
expect(RNLinking.openURL).toHaveBeenCalledWith('https://www.google.com')
|
|
92
76
|
})
|
|
93
77
|
|
|
94
|
-
|
|
78
|
+
it('calls the host methods bound to React Native Linking', async () => {
|
|
79
|
+
const receivers: unknown[] = []
|
|
95
80
|
const linking = new LinkingAdapter({
|
|
96
|
-
openURL: async function (
|
|
97
|
-
|
|
98
|
-
expect(this).toBe(RNLinking)
|
|
81
|
+
openURL: async function (this: unknown) {
|
|
82
|
+
receivers.push(this)
|
|
99
83
|
},
|
|
100
|
-
canOpenURL: async function (
|
|
101
|
-
|
|
102
|
-
expect(this).toBe(RNLinking)
|
|
103
|
-
|
|
84
|
+
canOpenURL: async function (this: unknown) {
|
|
85
|
+
receivers.push(this)
|
|
104
86
|
return true
|
|
105
87
|
},
|
|
106
88
|
})
|
|
107
89
|
|
|
108
|
-
linking.openURL('https://www.google.com')
|
|
109
|
-
linking.canOpenURL('https://www.google.com')
|
|
90
|
+
await linking.openURL('https://www.google.com')
|
|
91
|
+
await linking.canOpenURL('https://www.google.com')
|
|
92
|
+
|
|
93
|
+
expect(receivers).toEqual([RNLinking, RNLinking])
|
|
110
94
|
})
|
|
111
95
|
})
|
|
112
96
|
|
|
@@ -157,24 +141,5 @@ describe('ChatAdapters', () => {
|
|
|
157
141
|
|
|
158
142
|
expect(Haptic).toEqual(haptic)
|
|
159
143
|
})
|
|
160
|
-
|
|
161
|
-
it('should be configured with defaults', () => {
|
|
162
|
-
ChatAdapters.configure({
|
|
163
|
-
clipboard,
|
|
164
|
-
audio,
|
|
165
|
-
video,
|
|
166
|
-
imagePicker,
|
|
167
|
-
})
|
|
168
|
-
|
|
169
|
-
expect(Haptic).toBeDefined()
|
|
170
|
-
expect(Haptic.impactLight).toBeDefined()
|
|
171
|
-
expect(Haptic.impactMedium).toBeDefined()
|
|
172
|
-
expect(Haptic.impactHeavy).toBeDefined()
|
|
173
|
-
expect(Haptic.rigid).toBeDefined()
|
|
174
|
-
expect(Haptic.soft).toBeDefined()
|
|
175
|
-
expect(Haptic.notificationSuccess).toBeDefined()
|
|
176
|
-
expect(Haptic.notificationWarning).toBeDefined()
|
|
177
|
-
expect(Haptic.notificationError).toBeDefined()
|
|
178
|
-
})
|
|
179
144
|
})
|
|
180
145
|
})
|
|
@@ -51,12 +51,6 @@ describe('parseSimpleMarkdown', () => {
|
|
|
51
51
|
expect(result).toEqual([{ type: 'text', content: '* Item 1\n* Item 2\n* Item 3' }])
|
|
52
52
|
})
|
|
53
53
|
|
|
54
|
-
it('parses ordered lists correctly', () => {
|
|
55
|
-
const input = '1. Item 1\n2. Item 2\n3. Item 3'
|
|
56
|
-
const result = parseSimpleMarkdown(input)
|
|
57
|
-
expect(result).toEqual([{ type: 'text', content: '1. Item 1\n2. Item 2\n3. Item 3' }])
|
|
58
|
-
})
|
|
59
|
-
|
|
60
54
|
it('handles plain text without formatting', () => {
|
|
61
55
|
const input = 'Just plain text'
|
|
62
56
|
const result = parseSimpleMarkdown(input)
|
|
@@ -37,17 +37,6 @@ describe('Session', () => {
|
|
|
37
37
|
expect(hydratedSession.token).toEqual(token)
|
|
38
38
|
expect(hydratedSession.isAuthenticated).toEqual(true)
|
|
39
39
|
})
|
|
40
|
-
|
|
41
|
-
it('should store the environment of hydrated Session instance', () => {
|
|
42
|
-
const env = 'production'
|
|
43
|
-
const session = new Session({ token, env })
|
|
44
|
-
|
|
45
|
-
const sessionString = session.toString()
|
|
46
|
-
const hydratedSession = Session.hydrate(sessionString)
|
|
47
|
-
expect(hydratedSession.env).toEqual(env)
|
|
48
|
-
expect(hydratedSession.token).toEqual(token)
|
|
49
|
-
expect(hydratedSession.isAuthenticated).toEqual(true)
|
|
50
|
-
})
|
|
51
40
|
})
|
|
52
41
|
|
|
53
42
|
describe('failure', () => {
|
|
@@ -10,10 +10,6 @@ describe('defaultTheme', () => {
|
|
|
10
10
|
expect(defaultTheme('light').colors).toMatchObject(aliasTokensColorMap.light)
|
|
11
11
|
})
|
|
12
12
|
|
|
13
|
-
test('falls back to the light palette when colorScheme is null', () => {
|
|
14
|
-
expect(defaultTheme(null).colors).toMatchObject(aliasTokensColorMap.light)
|
|
15
|
-
})
|
|
16
|
-
|
|
17
13
|
test('falls back to the light palette for React Native 0.83\'s "unspecified" variant', () => {
|
|
18
14
|
// RN 0.83 added "unspecified" to ColorSchemeName. Anything that is not
|
|
19
15
|
// literally "dark" should fall through to the light palette so we never
|
|
@@ -22,19 +18,6 @@ describe('defaultTheme', () => {
|
|
|
22
18
|
})
|
|
23
19
|
|
|
24
20
|
describe('chip tokens', () => {
|
|
25
|
-
test('seeds static defaults for the non-selected chip trio in both schemes', () => {
|
|
26
|
-
const light = defaultTheme('light').colors
|
|
27
|
-
const dark = defaultTheme('dark').colors
|
|
28
|
-
|
|
29
|
-
expect(light.borderColorChip).toBe('hsl(0, 0%, 88%)')
|
|
30
|
-
expect(light.fillColorChip).toBe('transparent')
|
|
31
|
-
expect(light.textColorChip).toBe('hsl(0, 0%, 45%)')
|
|
32
|
-
|
|
33
|
-
expect(dark.borderColorChip).toBe('hsl(0, 0%, 24%)')
|
|
34
|
-
expect(dark.fillColorChip).toBe('transparent')
|
|
35
|
-
expect(dark.textColorChip).toBe('hsl(0, 0%, 68%)')
|
|
36
|
-
})
|
|
37
|
-
|
|
38
21
|
test('never seeds a static default for the selected chip trio', () => {
|
|
39
22
|
const { colors } = defaultTheme('light')
|
|
40
23
|
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { act, fireEvent, render } from '@testing-library/react-native'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
import { SafeAreaProvider } from 'react-native-safe-area-context'
|
|
4
|
+
import type { ConversationResource } from '../../../types'
|
|
5
|
+
import { BulkConversationActionsBar } from '../bulk_conversation_actions_bar'
|
|
6
|
+
|
|
7
|
+
jest.mock('react-native-reanimated', () => ({
|
|
8
|
+
...jest.requireActual('react-native-reanimated/mock'),
|
|
9
|
+
LayoutAnimationConfig: ({ children }: { children: React.ReactNode }) => children,
|
|
10
|
+
useReducedMotion: () => false,
|
|
11
|
+
}))
|
|
12
|
+
|
|
13
|
+
const mockHide = jest.fn(async () => {})
|
|
14
|
+
const mockSilence = jest.fn(async () => {})
|
|
15
|
+
jest.mock('../../../hooks/use_bulk_conversation_actions', () => ({
|
|
16
|
+
useBulkConversationActions: () => ({
|
|
17
|
+
hide: mockHide,
|
|
18
|
+
unhide: jest.fn(),
|
|
19
|
+
silence: mockSilence,
|
|
20
|
+
markRead: jest.fn(),
|
|
21
|
+
}),
|
|
22
|
+
}))
|
|
23
|
+
|
|
24
|
+
const createdAt = '2026-10-01T12:00:00Z'
|
|
25
|
+
|
|
26
|
+
const conversation = (overrides: Partial<ConversationResource>): ConversationResource => ({
|
|
27
|
+
type: 'Conversation',
|
|
28
|
+
id: 1,
|
|
29
|
+
title: 'Youth Group',
|
|
30
|
+
conversationPreview: null,
|
|
31
|
+
createdAt,
|
|
32
|
+
lastMessageCreatedAt: createdAt,
|
|
33
|
+
muted: false,
|
|
34
|
+
repliesDisabled: false,
|
|
35
|
+
unreadCount: 1,
|
|
36
|
+
unreadReaction: false,
|
|
37
|
+
updatedAt: createdAt,
|
|
38
|
+
...overrides,
|
|
39
|
+
})
|
|
40
|
+
|
|
41
|
+
const first = conversation({ id: 1 })
|
|
42
|
+
const second = conversation({ id: 2 })
|
|
43
|
+
const archived = conversation({ id: 3, disabled: true, disabledReason: 'archived' })
|
|
44
|
+
const mockConversations = [first, second, archived]
|
|
45
|
+
|
|
46
|
+
const mockClearSelection = jest.fn()
|
|
47
|
+
let mockSelectedIds: number[] = []
|
|
48
|
+
jest.mock('../../../contexts/conversations_context', () => ({
|
|
49
|
+
useConversationsContext: () => ({
|
|
50
|
+
selectMode: true,
|
|
51
|
+
selectedIds: mockSelectedIds,
|
|
52
|
+
conversations: mockConversations,
|
|
53
|
+
hideable: true,
|
|
54
|
+
clearSelection: mockClearSelection,
|
|
55
|
+
args: {},
|
|
56
|
+
}),
|
|
57
|
+
}))
|
|
58
|
+
|
|
59
|
+
const safeAreaMetrics = {
|
|
60
|
+
frame: { x: 0, y: 0, width: 390, height: 844 },
|
|
61
|
+
insets: { top: 0, right: 0, bottom: 0, left: 0 },
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const renderBar = () =>
|
|
65
|
+
render(
|
|
66
|
+
<SafeAreaProvider initialMetrics={safeAreaMetrics}>
|
|
67
|
+
<BulkConversationActionsBar />
|
|
68
|
+
</SafeAreaProvider>
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
describe('BulkConversationActionsBar', () => {
|
|
72
|
+
beforeEach(() => jest.clearAllMocks())
|
|
73
|
+
|
|
74
|
+
it('hides every selected conversation and then clears the selection', async () => {
|
|
75
|
+
mockSelectedIds = [1, 2]
|
|
76
|
+
const view = renderBar()
|
|
77
|
+
|
|
78
|
+
await act(async () => fireEvent.press(view.getByText('Hide')))
|
|
79
|
+
|
|
80
|
+
expect(mockHide).toHaveBeenCalledWith([first, second])
|
|
81
|
+
expect(mockClearSelection).toHaveBeenCalled()
|
|
82
|
+
})
|
|
83
|
+
|
|
84
|
+
it('disables hide and silence when an archived conversation is selected', () => {
|
|
85
|
+
mockSelectedIds = [1, 3]
|
|
86
|
+
const view = renderBar()
|
|
87
|
+
|
|
88
|
+
fireEvent.press(view.getByText('Hide'))
|
|
89
|
+
fireEvent.press(view.getByText('Silence'))
|
|
90
|
+
|
|
91
|
+
expect(mockHide).not.toHaveBeenCalled()
|
|
92
|
+
expect(mockSilence).not.toHaveBeenCalled()
|
|
93
|
+
expect(mockClearSelection).not.toHaveBeenCalled()
|
|
94
|
+
})
|
|
95
|
+
})
|
|
@@ -67,9 +67,13 @@ const conversation = (overrides: Partial<ConversationResource>): ConversationRes
|
|
|
67
67
|
...overrides,
|
|
68
68
|
})
|
|
69
69
|
|
|
70
|
-
const renderActions = (overrides: Partial<ConversationResource
|
|
70
|
+
const renderActions = (overrides: Partial<ConversationResource>, selected?: boolean) =>
|
|
71
71
|
render(
|
|
72
|
-
<ConversationActions
|
|
72
|
+
<ConversationActions
|
|
73
|
+
conversation={conversation(overrides)}
|
|
74
|
+
onPress={jest.fn()}
|
|
75
|
+
selected={selected}
|
|
76
|
+
>
|
|
73
77
|
<Text>Youth Group</Text>
|
|
74
78
|
</ConversationActions>
|
|
75
79
|
)
|
|
@@ -137,6 +141,34 @@ describe('ConversationActions hide', () => {
|
|
|
137
141
|
|
|
138
142
|
fireEvent(view.getByTestId('conversation-7'), 'longPress')
|
|
139
143
|
|
|
140
|
-
expect(mockNavigate).toHaveBeenCalledWith('ConversationActions', {
|
|
144
|
+
expect(mockNavigate).toHaveBeenCalledWith('ConversationActions', {
|
|
145
|
+
conversation_id: 7,
|
|
146
|
+
read: false,
|
|
147
|
+
muted: false,
|
|
148
|
+
})
|
|
149
|
+
})
|
|
150
|
+
})
|
|
151
|
+
|
|
152
|
+
describe('ConversationActions select mode', () => {
|
|
153
|
+
beforeEach(() => {
|
|
154
|
+
mockHideEnabled = true
|
|
155
|
+
mockHideable = true
|
|
156
|
+
})
|
|
157
|
+
|
|
158
|
+
it('presents the row as a checked checkbox without row actions', () => {
|
|
159
|
+
const view = renderActions({}, true)
|
|
160
|
+
const row = view.getByTestId('conversation-7')
|
|
161
|
+
|
|
162
|
+
expect(row.props.accessibilityRole).toBe('checkbox')
|
|
163
|
+
expect(row.props.accessibilityState).toEqual({ checked: true })
|
|
164
|
+
expect(row.props.accessibilityActions).toEqual([])
|
|
165
|
+
})
|
|
166
|
+
|
|
167
|
+
it('keeps the button role and row actions outside select mode', () => {
|
|
168
|
+
const view = renderActions({})
|
|
169
|
+
const row = view.getByTestId('conversation-7')
|
|
170
|
+
|
|
171
|
+
expect(row.props.accessibilityRole).toBe('button')
|
|
172
|
+
expect(row.props.accessibilityActions.length).toBeGreaterThan(0)
|
|
141
173
|
})
|
|
142
174
|
})
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { fireEvent } from '@testing-library/react-native'
|
|
1
2
|
import React from 'react'
|
|
2
3
|
import { renderWithQueryClient } from '../../../__utils__/render_with_query_client'
|
|
3
4
|
import { ConversationFiltersParams } from '../../../screens/conversation_filters/screen_props'
|
|
@@ -6,19 +7,40 @@ import { formatDatePreview } from '../../../utils/date'
|
|
|
6
7
|
import { ConversationPreview } from '../conversation_preview'
|
|
7
8
|
|
|
8
9
|
let mockArgs: ConversationFiltersParams = {}
|
|
10
|
+
let mockSelectMode = false
|
|
11
|
+
let mockSelectedIds: number[] = []
|
|
12
|
+
const mockToggleSelected = jest.fn()
|
|
9
13
|
jest.mock('../../../contexts/conversations_context', () => ({
|
|
10
|
-
useConversationsContext: () => ({
|
|
14
|
+
useConversationsContext: () => ({
|
|
15
|
+
args: mockArgs,
|
|
16
|
+
selectMode: mockSelectMode,
|
|
17
|
+
selectedIds: mockSelectedIds,
|
|
18
|
+
toggleSelected: mockToggleSelected,
|
|
19
|
+
}),
|
|
11
20
|
}))
|
|
12
21
|
jest.mock('../conversation_actions', () => ({
|
|
13
22
|
ConversationActions: ({
|
|
14
23
|
children,
|
|
15
24
|
accessibilityLabel,
|
|
25
|
+
onPress,
|
|
26
|
+
selected,
|
|
16
27
|
}: {
|
|
17
28
|
children: React.ReactNode
|
|
18
29
|
accessibilityLabel?: string
|
|
30
|
+
onPress: () => void
|
|
31
|
+
selected?: boolean
|
|
19
32
|
}) => {
|
|
20
|
-
const {
|
|
21
|
-
return
|
|
33
|
+
const { Pressable: MockPressable } = jest.requireActual('react-native')
|
|
34
|
+
return (
|
|
35
|
+
<MockPressable
|
|
36
|
+
accessibilityLabel={accessibilityLabel}
|
|
37
|
+
accessibilityRole="checkbox"
|
|
38
|
+
accessibilityState={{ checked: selected }}
|
|
39
|
+
onPress={onPress}
|
|
40
|
+
>
|
|
41
|
+
{children}
|
|
42
|
+
</MockPressable>
|
|
43
|
+
)
|
|
22
44
|
},
|
|
23
45
|
}))
|
|
24
46
|
|
|
@@ -131,4 +153,48 @@ describe('ConversationPreview', () => {
|
|
|
131
153
|
).toBeNull()
|
|
132
154
|
})
|
|
133
155
|
})
|
|
156
|
+
|
|
157
|
+
describe('select mode', () => {
|
|
158
|
+
const onPress = jest.fn()
|
|
159
|
+
const renderSelectable = () =>
|
|
160
|
+
renderWithQueryClient(
|
|
161
|
+
<ConversationPreview conversation={conversation(messagePreview)} onPress={onPress} />
|
|
162
|
+
)
|
|
163
|
+
|
|
164
|
+
beforeEach(() => {
|
|
165
|
+
mockSelectMode = true
|
|
166
|
+
mockSelectedIds = []
|
|
167
|
+
jest.clearAllMocks()
|
|
168
|
+
})
|
|
169
|
+
|
|
170
|
+
afterAll(() => {
|
|
171
|
+
mockSelectMode = false
|
|
172
|
+
})
|
|
173
|
+
|
|
174
|
+
it('toggles the conversation instead of opening it', () => {
|
|
175
|
+
const view = renderSelectable()
|
|
176
|
+
|
|
177
|
+
fireEvent.press(view.getByText('Worship Team'))
|
|
178
|
+
|
|
179
|
+
expect(mockToggleSelected).toHaveBeenCalledWith(7)
|
|
180
|
+
expect(onPress).not.toHaveBeenCalled()
|
|
181
|
+
})
|
|
182
|
+
|
|
183
|
+
it('marks a selected conversation as checked', () => {
|
|
184
|
+
mockSelectedIds = [7]
|
|
185
|
+
const view = renderSelectable()
|
|
186
|
+
|
|
187
|
+
expect(view.getByRole('checkbox', { checked: true })).toBeTruthy()
|
|
188
|
+
})
|
|
189
|
+
|
|
190
|
+
it('opens the conversation outside select mode', () => {
|
|
191
|
+
mockSelectMode = false
|
|
192
|
+
const view = renderSelectable()
|
|
193
|
+
|
|
194
|
+
fireEvent.press(view.getByText('Worship Team'))
|
|
195
|
+
|
|
196
|
+
expect(onPress).toHaveBeenCalled()
|
|
197
|
+
expect(mockToggleSelected).not.toHaveBeenCalled()
|
|
198
|
+
})
|
|
199
|
+
})
|
|
134
200
|
})
|
|
@@ -58,12 +58,15 @@ describe('Conversations archived footer', () => {
|
|
|
58
58
|
|
|
59
59
|
fireEvent.press(view.getByLabelText('View active conversations'))
|
|
60
60
|
|
|
61
|
-
expect(mockSetParams).
|
|
61
|
+
expect(mockSetParams).toHaveBeenCalledTimes(1)
|
|
62
|
+
expect(mockSetParams.mock.calls[0][0]).toStrictEqual({
|
|
62
63
|
title: undefined,
|
|
63
64
|
chat_group_graph_id: undefined,
|
|
64
65
|
group_source_app_name: undefined,
|
|
65
66
|
show_direct_messages: undefined,
|
|
66
67
|
show_archived: undefined,
|
|
68
|
+
show_hidden: undefined,
|
|
69
|
+
show_unread: undefined,
|
|
67
70
|
})
|
|
68
71
|
})
|
|
69
72
|
|