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
6 changes: 3 additions & 3 deletions apps/meteor/client/views/room/Sidepanel/RoomSidepanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import RoomSidepanelListWrapper from './RoomSidepanelListWrapper';
import RoomSidepanelLoading from './RoomSidepanelLoading';
import RoomSidepanelItem from './SidepanelItem';
import { useTeamsListChildrenUpdate } from './hooks/useTeamslistChildren';
import { CustomScrollbars } from '../../../components/CustomScrollbars';
import { VirtualizedScrollbars } from '../../../components/CustomScrollbars';
import { useRoomInfoEndpoint } from '../../../hooks/useRoomInfoEndpoint';
import { useOpenedRoom, useSecondLevelOpenedRoom } from '../../../lib/RoomManager';

Expand Down Expand Up @@ -50,7 +50,7 @@ const RoomSidepanelWithData = ({ parentRid, openedRoom }: { parentRid: string; o
return (
<Sidepanel>
<Box pb={8} h='full'>
<CustomScrollbars>
<VirtualizedScrollbars>
<Virtuoso
totalCount={result.data.length}
data={result.data}
Expand All @@ -59,7 +59,7 @@ const RoomSidepanelWithData = ({ parentRid, openedRoom }: { parentRid: string; o
<RoomSidepanelItem openedRoom={openedRoom} room={data} parentRid={parentRid} viewMode={sidebarViewMode} />
)}
/>
</CustomScrollbars>
</VirtualizedScrollbars>
</Box>
</Sidepanel>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
ContextualbarClose,
ContextualbarEmptyContent,
} from '../../../components/Contextualbar';
import { CustomScrollbars } from '../../../components/CustomScrollbars';
import { VirtualizedScrollbars } from '../../../components/CustomScrollbars';
import RoomMessage from '../../../components/message/variants/RoomMessage';
import SystemMessage from '../../../components/message/variants/SystemMessage';
import { useFormatDate } from '../../../hooks/useFormatDate';
Expand Down Expand Up @@ -67,7 +67,7 @@ const MessageListTab = ({ iconName, title, emptyResultMessage, context, queryRes
<MessageListErrorBoundary>
<MessageListProvider>
<Box is='section' display='flex' flexDirection='column' flexGrow={1} flexShrink={1} flexBasis='auto' height='full'>
<CustomScrollbars>
<VirtualizedScrollbars>
<Virtuoso
totalCount={queryResult.data.length}
overscan={25}
Expand Down Expand Up @@ -104,7 +104,7 @@ const MessageListTab = ({ iconName, title, emptyResultMessage, context, queryRes
);
}}
/>
</CustomScrollbars>
</VirtualizedScrollbars>
</Box>
</MessageListProvider>
</MessageListErrorBoundary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Virtuoso } from 'react-virtuoso';

import { MessageTypes } from '../../../../../../app/ui-utils/client';
import { ContextualbarEmptyContent } from '../../../../../components/Contextualbar';
import { CustomScrollbars } from '../../../../../components/CustomScrollbars';
import { VirtualizedScrollbars } from '../../../../../components/CustomScrollbars';
import RoomMessage from '../../../../../components/message/variants/RoomMessage';
import SystemMessage from '../../../../../components/message/variants/SystemMessage';
import { useFormatDate } from '../../../../../hooks/useFormatDate';
Expand Down Expand Up @@ -41,7 +41,7 @@ const MessageSearch = ({ searchText, globalSearch }: MessageSearchProps): ReactE
<MessageListErrorBoundary>
<MessageListProvider>
<Box is='section' display='flex' flexDirection='column' flexGrow={1} flexShrink={1} flexBasis='auto' height='full'>
<CustomScrollbars>
<VirtualizedScrollbars>
<Virtuoso
totalCount={messageSearchQuery.data.length}
overscan={25}
Expand Down Expand Up @@ -82,7 +82,7 @@ const MessageSearch = ({ searchText, globalSearch }: MessageSearchProps): ReactE
setLimit((limit) => limit + pageSize);
}}
/>
</CustomScrollbars>
</VirtualizedScrollbars>
</Box>
</MessageListProvider>
</MessageListErrorBoundary>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/* eslint-disable testing-library/no-container */
/* eslint-disable testing-library/no-node-access */
import { mockAppRoot } from '@rocket.chat/mock-providers';
import { render, waitFor } from '@testing-library/react';

import TeamsChannels from './TeamsChannels';
import { createFakeRoom } from '../../../../../tests/mocks/data';

jest.mock('../../../../lib/rooms/roomCoordinator', () => ({
roomCoordinator: {
getRouteLink: () => undefined,
},
}));

const mainRoom = createFakeRoom({ name: 'Main Room' });
const fakeRooms = Array.from({ length: 10 }, (_, index) => createFakeRoom({ t: 'c', name: `Fake Room ${index}` }));

beforeEach(() => {
Object.defineProperty(window, 'getComputedStyle', {
value: () => {
return {
getPropertyPriority: () => undefined,
getPropertyValue: () => undefined,
};
},
});
});

// TODO: Replace this with the storybook & snapshot
it('should render scrollbars', async () => {
const { container } = render(
<TeamsChannels
text=''
type='all'
reload={() => undefined}
loadMoreItems={() => undefined}
setText={() => undefined}
setType={() => undefined}
onClickClose={() => undefined}
onClickAddExisting={() => undefined}
onClickView={() => undefined}
onClickCreateNew={() => undefined}
total={fakeRooms.length}
loading={false}
mainRoom={mainRoom}
channels={fakeRooms}
/>,
{
wrapper: mockAppRoot().build(),
},
);

await waitFor(() => {
expect(container.querySelector('[data-overlayscrollbars]')).toBeInTheDocument();
});

expect(container.querySelector('[data-overlayscrollbars]')).toBeInTheDocument();
});
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
ContextualbarEmptyContent,
ContextualbarSection,
} from '../../../../components/Contextualbar';
import { CustomScrollbars } from '../../../../components/CustomScrollbars';
import { VirtualizedScrollbars } from '../../../../components/CustomScrollbars';
import InfiniteListAnchor from '../../../../components/InfiniteListAnchor';

type TeamsChannelsProps = {
Expand Down Expand Up @@ -111,7 +111,7 @@ const TeamsChannels = ({
</Box>
</Box>
<Box w='full' h='full' role='list' overflow='hidden' flexShrink={1}>
<CustomScrollbars>
<VirtualizedScrollbars>
<Virtuoso
totalCount={total}
data={channels}
Expand All @@ -121,7 +121,7 @@ const TeamsChannels = ({
<TeamsChannelItem onClickView={onClickView} room={data} mainRoom={mainRoom} reload={reload} key={index} />
)}
/>
</CustomScrollbars>
</VirtualizedScrollbars>
</Box>
</>
)}
Expand Down
Loading