mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 00:40:14 +01:00
* added button for autoscroll
* fix(General) removed bold
* fix(General) typescript error with checked={autoScroll}
* added return condition for new conversations
* refactor(Message) limit nesting
* fix(settings) used effects
* fix(Message) disabled autoscroll when search
* test(AutoScrollSwitch)
* fix(AutoScrollSwitch) test
* fix(ci): attempt to debug workflow
* refactor: move AutoScrollSwitch from General file, don't use cache for npm
* fix(ci): add test config to avoid redirects and silentRefresh
* chore: add back workflow caching
* chore(AutoScrollSwitch): remove comments, fix type issues, clarify switch intent
* refactor(Message): remove unnecessary message prop form scrolling condition
* fix(AutoScrollSwitch.spec): do not get by text
---------
Co-authored-by: Danny Avila <messagedaniel@protonmail.com>
33 lines
1 KiB
TypeScript
33 lines
1 KiB
TypeScript
import './matchMedia.mock';
|
|
import React from 'react';
|
|
import { render as rtlRender } from '@testing-library/react';
|
|
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
|
import { AuthContextProvider } from '~/hooks/AuthContext';
|
|
import { BrowserRouter as Router } from 'react-router-dom';
|
|
import { RecoilRoot } from 'recoil';
|
|
|
|
const client = new QueryClient();
|
|
|
|
function renderWithProvidersWrapper(ui, { ...options } = {}) {
|
|
function Wrapper({ children }) {
|
|
return (
|
|
<QueryClientProvider client={client}>
|
|
<RecoilRoot>
|
|
<Router>
|
|
<AuthContextProvider
|
|
authConfig={{
|
|
loginRedirect: '',
|
|
test: true,
|
|
}}
|
|
>
|
|
{children}
|
|
</AuthContextProvider>
|
|
</Router>
|
|
</RecoilRoot>
|
|
</QueryClientProvider>
|
|
);
|
|
}
|
|
return rtlRender(ui, { wrapper: Wrapper, ...options });
|
|
}
|
|
export * from '@testing-library/react';
|
|
export { renderWithProvidersWrapper as render };
|