Skip to content

Commit ad6ad42

Browse files
committed
fix: add test id
1 parent e633109 commit ad6ad42

File tree

6 files changed

+41
-1
lines changed

6 files changed

+41
-1
lines changed

package/src/components/MessageInput/__tests__/AudioAttachmentUploadPreview.test.js

Whitespace-only changes.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import React from 'react';
2+
3+
import { act, render, screen, userEvent, waitFor } from '@testing-library/react-native';
4+
5+
import { OverlayProvider } from '../../../contexts';
6+
7+
import { initiateClientWithChannels } from '../../../mock-builders/api/initiateClientWithChannels';
8+
import { Channel } from '../../Channel/Channel';
9+
import { Chat } from '../../Chat/Chat';
10+
import { SendButton } from '../SendButton';
11+
12+
const renderComponent = ({ client, channel, props }) => {
13+
return render(
14+
<OverlayProvider>
15+
<Chat client={client}>
16+
<Channel channel={channel}>
17+
<SendButton {...props} />
18+
</Channel>
19+
</Chat>
20+
</OverlayProvider>,
21+
);
22+
};

package/src/components/MessageInput/__tests__/InputButtons.test.js

Whitespace-only changes.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export const ImageAttachmentUploadPreview = ({
5454
}, []);
5555

5656
return (
57-
<View style={[styles.itemContainer, itemContainer]}>
57+
<View style={[styles.itemContainer, itemContainer]} testID={'image-attachment-upload-preview'}>
5858
<AttachmentUploadProgressIndicator
5959
onPress={onRetryHandler}
6060
style={styles.upload}

package/src/mock-builders/api/initiateClientWithChannels.js

Whitespace-only changes.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { generateRandomId } from '../../utils/utils';
2+
3+
export const generateImageAttachment = (a) => ({
4+
fallback: generateRandomId() + '.png',
5+
image_url: 'https://' + generateRandomId() + '.png',
6+
type: 'image',
7+
...a,
8+
});
9+
10+
const fileName = generateRandomId() + '.png';
11+
12+
export const generateFileReference = (a) => ({
13+
name: fileName,
14+
size: 1000,
15+
type: 'image/png',
16+
uri: 'file://' + generateRandomId() + '.png',
17+
...a,
18+
});

0 commit comments

Comments
 (0)