Skip to content

Commit e62dc84

Browse files
committed
style: fix lint issues in test
1 parent 1753842 commit e62dc84

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

package/src/components/ChannelList/hooks/listeners/__tests__/useChannelUpdated.test.tsx

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
import React, { useState } from 'react';
22
import { Text } from 'react-native';
3+
4+
import { act } from 'react-test-renderer';
5+
36
import { render, waitFor } from '@testing-library/react-native';
47
import type { Channel, ChannelResponse, Event, StreamChat } from 'stream-chat';
8+
59
import { ChatContext, useChannelUpdated } from '../../../../../index';
6-
import { act } from 'react-test-renderer';
710

811
describe('useChannelUpdated', () => {
912
it("defaults to the channels own_capabilities if the event doesn't include it", async () => {
10-
let eventHanler: (event: Event) => any;
13+
let eventHanler: (event: Event) => void;
1114
const mockChannel = {
1215
cid: 'channeltype:123abc',
1316
data: {
@@ -25,10 +28,10 @@ describe('useChannelUpdated', () => {
2528
};
2629

2730
const mockClient = {
28-
on: jest.fn().mockImplementation((_eventName: string, handler: (event: Event) => any) => {
31+
off: jest.fn(),
32+
on: jest.fn().mockImplementation((_eventName: string, handler: (event: Event) => void) => {
2933
eventHanler = handler;
3034
}),
31-
off: jest.fn(),
3235
} as unknown as StreamChat;
3336

3437
const TestComponent = () => {
@@ -38,7 +41,9 @@ describe('useChannelUpdated', () => {
3841

3942
if (
4043
channels[0].data?.own_capabilities &&
41-
Object.keys(channels[0].data?.own_capabilities as any).includes('send_messages')
44+
Object.keys(channels[0].data?.own_capabilities as { [key: string]: boolean }).includes(
45+
'send_messages',
46+
)
4247
) {
4348
return <Text>Send messages enabled</Text>;
4449
}

0 commit comments

Comments
 (0)