Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const createComposerAPI = (
persistDraft: (value: string) => void,
initialDraft: string,
quoteChainLimit: number,
composerRef: RefObject<HTMLElement>,
composerRef: RefObject<HTMLElement | null>,
{ rid, tmid }: { rid: string; tmid?: string },
): ComposerAPI => {
const triggerEvent = (input: HTMLTextAreaElement, evt: string): void => {
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/client/lib/chats/ChatAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export type ComposerAPI = {

readonly formatters: Subscribable<FormattingButton[]>;

readonly composerRef: RefObject<HTMLElement>;
readonly composerRef: RefObject<HTMLElement | null>;

readonly uploads: UploadsAPI;
};
Expand Down
4 changes: 2 additions & 2 deletions apps/meteor/tests/mocks/client/FakeChatProvider.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ReactElement, ReactNode } from 'react';
import type { ReactNode } from 'react';

import { ChatContext } from '../../../client/views/room/contexts/ChatContext';
import { createFakeSubscription } from '../data';
Expand All @@ -7,7 +7,7 @@ type FakeChatProviderProps = {
children?: ReactNode;
};

const FakeChatProvider = ({ children }: FakeChatProviderProps): ReactElement => {
const FakeChatProvider = ({ children }: FakeChatProviderProps) => {
return (
<ChatContext.Provider
value={
Expand Down
4 changes: 2 additions & 2 deletions apps/meteor/tests/mocks/client/FakeRoomProvider.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { faker } from '@faker-js/faker';
import type { IRoom, ISubscription } from '@rocket.chat/core-typings';
import type { ReactNode, ReactElement } from 'react';
import type { ReactNode } from 'react';
import { useMemo } from 'react';

import { RoomContext } from '../../../client/views/room/contexts/RoomContext';
Expand All @@ -12,7 +12,7 @@ type FakeRoomProviderProps = {
subscriptionOverrides?: Partial<ISubscription>;
};

const FakeRoomProvider = ({ children, roomOverrides, subscriptionOverrides }: FakeRoomProviderProps): ReactElement => {
const FakeRoomProvider = ({ children, roomOverrides, subscriptionOverrides }: FakeRoomProviderProps) => {
return (
<RoomContext.Provider
value={useMemo(() => {
Expand Down
4 changes: 2 additions & 2 deletions apps/meteor/tests/mocks/client/ModalContextMock.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { ModalContext } from '@rocket.chat/ui-contexts';
import type { ReactElement, ContextType, ReactNode } from 'react';
import type { ContextType, ReactNode } from 'react';
import { useMemo } from 'react';

type ModalContextMockProps = {
children: ReactNode;
};

const ModalContextMock = ({ children }: ModalContextMockProps): ReactElement => {
const ModalContextMock = ({ children }: ModalContextMockProps) => {
const value = useMemo(
() => ({
modal: {
Expand Down
10 changes: 2 additions & 8 deletions apps/meteor/tests/mocks/client/RouterContextMock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { To, SearchParameters, LocationPathname, LocationSearch } from '@ro
import { RouterContext } from '@rocket.chat/ui-contexts';
import { compile } from 'path-to-regexp';
import { useRef, useMemo } from 'react';
import type { MutableRefObject, ReactElement, ReactNode } from 'react';
import type { MutableRefObject, ReactNode } from 'react';

const encodeSearchParameters = (searchParameters: SearchParameters) => {
const search = new URLSearchParams();
Expand Down Expand Up @@ -63,13 +63,7 @@ type RouterContextMockProps = {
routeParameters?: Record<string, any>;
};

const RouterContextMock = ({
children,
navigate,
currentPath,
searchParameters = {},
routeParameters = {},
}: RouterContextMockProps): ReactElement => {
const RouterContextMock = ({ children, navigate, currentPath, searchParameters = {}, routeParameters = {} }: RouterContextMockProps) => {
const history = useRef<{ stack: To[]; index: number }>({ stack: ['/'], index: 0 });

if (currentPath) {
Expand Down
Loading