Skip to content

Commit fbf3197

Browse files
committed
fix: tests from merge
1 parent 4d264dd commit fbf3197

3 files changed

Lines changed: 20 additions & 13 deletions

File tree

package/src/components/Attachment/__tests__/Attachment.test.tsx

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import { StyleSheet, View } from 'react-native';
44
import { render, waitFor } from '@testing-library/react-native';
55
import { v4 as uuidv4 } from 'uuid';
66

7-
import type { MessageContextValue } from '../../../contexts/messageContext/MessageContext';
87
import { AudioPlayerProvider } from '../../../contexts/audioPlayerContext/AudioPlayerContext';
8+
import type { MessageContextValue } from '../../../contexts/messageContext/MessageContext';
99
import { MessageProvider } from '../../../contexts/messageContext/MessageContext';
1010
import type { MessagesContextValue } from '../../../contexts/messagesContext/MessagesContext';
1111
import { MessagesProvider } from '../../../contexts/messagesContext/MessagesContext';
@@ -52,13 +52,16 @@ const getAttachmentComponent = (props: ComponentProps<typeof Attachment>) => {
5252
<ThemeProvider>
5353
<AudioPlayerProvider value={{ allowConcurrentAudioPlayback: false }}>
5454
<MessagesProvider
55-
value={{
56-
FilePreview: FilePreviewDefault,
57-
ImageLoadingFailedIndicator,
58-
ImageLoadingIndicator,
59-
} as unknown as MessagesContextValue}
55+
value={
56+
{
57+
FilePreview: FilePreviewDefault,
58+
ImageLoadingFailedIndicator,
59+
ImageLoadingIndicator,
60+
message,
61+
} as unknown as MessagesContextValue
62+
}
6063
>
61-
<MessageProvider value={{ message } as unknown as MessagesContextValue}>
64+
<MessageProvider value={{ message } as unknown as MessageContextValue}>
6265
<Attachment {...props} />
6366
</MessageProvider>
6467
</MessagesProvider>

package/src/components/Attachment/__tests__/Giphy.test.tsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,16 @@ describe('Giphy', () => {
5050
return (
5151
<ThemeProvider>
5252
<MessagesProvider
53-
value={{
54-
ImageLoadingFailedIndicator,
55-
ImageLoadingIndicator,
56-
} as unknown as MessagesContextValue}
53+
value={
54+
{
55+
ImageLoadingFailedIndicator,
56+
ImageLoadingIndicator,
57+
} as unknown as MessagesContextValue
58+
}
5759
>
58-
<MessageProvider value={{ message, ...messageContextValue } as unknown as MessagesContextValue}>
60+
<MessageProvider
61+
value={{ message, ...messageContextValue } as unknown as MessagesContextValue}
62+
>
5963
<Giphy {...props} />
6064
</MessageProvider>
6165
</MessagesProvider>

package/src/components/MessageInput/components/AttachmentPreview/VideoAttachmentUploadPreview.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ import { LocalImageAttachment, LocalVideoAttachment } from 'stream-chat';
77
import { FileAttachmentUploadPreview } from './FileAttachmentUploadPreview';
88
import { ImageAttachmentUploadPreview } from './ImageAttachmentUploadPreview';
99

10+
import { useMessageInputContext } from '../../../../contexts';
1011
import { useTheme } from '../../../../contexts/themeContext/ThemeContext';
1112
import { Recorder } from '../../../../icons';
1213
import { primitives } from '../../../../theme';
1314
import { UploadAttachmentPreviewProps } from '../../../../types/types';
1415
import { formatMsToMinSec, getDurationLabelFromDuration } from '../../../../utils/utils';
15-
import { useMessageInputContext } from '../../../../contexts';
1616

1717
export type VideoAttachmentUploadPreviewProps<CustomLocalMetadata = Record<string, unknown>> =
1818
UploadAttachmentPreviewProps<LocalVideoAttachment<CustomLocalMetadata>>;

0 commit comments

Comments
 (0)