Skip to content

Commit fdf5900

Browse files
committed
fix: more tests
1 parent 46d2605 commit fdf5900

File tree

4 files changed

+10
-15
lines changed

4 files changed

+10
-15
lines changed

package/src/components/AutoCompleteInput/__tests__/AutoCompleteInput.test.js

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
11
import React from 'react';
22

3-
import {
4-
act,
5-
cleanup,
6-
fireEvent,
7-
render,
8-
screen,
9-
userEvent,
10-
waitFor,
11-
} from '@testing-library/react-native';
3+
import { act, cleanup, fireEvent, render, screen, waitFor } from '@testing-library/react-native';
124

135
import { OverlayProvider } from '../../../contexts';
146
import { initiateClientWithChannels } from '../../../mock-builders/api/initiateClientWithChannels';
@@ -108,7 +100,7 @@ describe('AutoCompleteInput', () => {
108100
const input = queryByTestId('auto-complete-text-input');
109101

110102
act(() => {
111-
userEvent.type(input, 'hello');
103+
fireEvent.changeText(input, 'hello');
112104
});
113105

114106
await waitFor(() => {

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,12 @@ describe('SendButton', () => {
3232
});
3333

3434
afterEach(() => {
35-
channel.messageComposer.clear();
3635
jest.clearAllMocks();
3736
cleanup();
37+
38+
act(() => {
39+
channel.messageComposer.clear();
40+
});
3841
});
3942

4043
it('should render a SendButton', async () => {

package/src/components/MessageMenu/__tests__/MessageUserReactions.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,9 @@ describe('MessageUserReactions when the supportedReactions are defined', () => {
110110
expect(reactionButtons[1].props.accessibilityLabel).toBe('reaction-button-love-selected');
111111
});
112112

113-
it('renders reactions list', async () => {
113+
it('renders reactions list', () => {
114114
const { getByText } = renderComponent();
115-
const reactionItems = await getByText('1 like');
115+
const reactionItems = getByText('1 like');
116116
expect(reactionItems).toBeDefined();
117117
});
118118

package/src/contexts/messageInputContext/__tests__/filePickers.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ describe("MessageInputContext's pickAndUploadImageFromNativePicker", () => {
128128
let channel;
129129
let chatClient;
130130

131-
beforeAll(async () => {
131+
beforeEach(async () => {
132132
const { client, channels } = await initiateClientWithChannels();
133133
channel = channels[0];
134134
chatClient = client;
@@ -227,7 +227,7 @@ describe("MessageInputContext's takeAndUploadImage", () => {
227227
let channel;
228228
let chatClient;
229229

230-
beforeAll(async () => {
230+
beforeEach(async () => {
231231
const { client, channels } = await initiateClientWithChannels();
232232
channel = channels[0];
233233
chatClient = client;

0 commit comments

Comments
 (0)