mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-16 16:30:15 +01:00
Feat/startup config api (#518)
* feat: add api for config * feat: add data service to client * feat: update client pages with values from config endpoint * test: update tests * Update configurations and documentation to remove VITE_SHOW_GOOGLE_LOGIN_OPTION and change VITE_APP_TITLE to APP_TITLE * include APP_TITLE with startup config * Add test for new route * update backend-review pipeline * comment out test until we can figure out testing routes in CI * update: .env.example --------- Co-authored-by: fuegovic <32828263+fuegovic@users.noreply.github.com>
This commit is contained in:
parent
2da81db440
commit
3634d8691a
25 changed files with 419 additions and 75 deletions
|
|
@ -3,11 +3,6 @@ import userEvent from '@testing-library/user-event';
|
|||
import Registration from '../Registration';
|
||||
import * as mockDataProvider from '~/data-provider';
|
||||
|
||||
jest.mock('~/utils/envConstants', () => ({
|
||||
DOMAIN_SERVER: 'mock-server',
|
||||
SHOW_GOOGLE_LOGIN_OPTION: true
|
||||
}));
|
||||
|
||||
jest.mock('~/data-provider');
|
||||
|
||||
const setup = ({
|
||||
|
|
@ -22,6 +17,15 @@ const setup = ({
|
|||
mutate: jest.fn(),
|
||||
data: {},
|
||||
isSuccess: false
|
||||
},
|
||||
useGetStartupCongfigReturnValue = {
|
||||
isLoading: false,
|
||||
isError: false,
|
||||
data: {
|
||||
googleLoginEnabled: true,
|
||||
registrationEnabled: true,
|
||||
serverDomain: 'mock-server'
|
||||
}
|
||||
}
|
||||
} = {}) => {
|
||||
const mockUseRegisterUserMutation = jest
|
||||
|
|
@ -32,13 +36,18 @@ const setup = ({
|
|||
.spyOn(mockDataProvider, 'useGetUserQuery')
|
||||
//@ts-ignore - we don't need all parameters of the QueryObserverSuccessResult
|
||||
.mockReturnValue(useGetUserQueryReturnValue);
|
||||
const mockUseGetStartupConfig = jest
|
||||
.spyOn(mockDataProvider, 'useGetStartupConfig')
|
||||
//@ts-ignore - we don't need all parameters of the QueryObserverSuccessResult
|
||||
.mockReturnValue(useGetStartupCongfigReturnValue);
|
||||
|
||||
const renderResult = render(<Registration />);
|
||||
|
||||
return {
|
||||
...renderResult,
|
||||
mockUseRegisterUserMutation,
|
||||
mockUseGetUserQuery
|
||||
mockUseGetUserQuery,
|
||||
mockUseGetStartupConfig
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue