mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 00:40:14 +01:00
* Add files via upload * Create linode-setup.md * Create cloudflare-setup.md * Update cloudflare-setup.md * Delete 4-linode.png * Delete 3-linode.png * Add files via upload * Add files via upload * Update cloudflare-setup.md * Update linode-setup.md * Rename cloudflare-setup.md to cloudflare.md * Rename linode-setup.md to linode.md * Update mkdocs.yml * Update cloudflare.md * Update linode.md * Update README.md * Update README.md * Update linode.md sentence in Italian * v1 The frontend has been completed, along with the .env variables. However, there is an issue of infinite loading thereafter. * Fix email and remove deprecated GitHub passport * Update user_auth_system.md add How to Set Up a Github Authentication * Update .env.example Improved the comment above the GitHub client ID and secret. * Update user_auth_system.md * Update package.json * Remove unnecessary passport GitHub package * fixed conflicts fixed conflicts between Berry-13:main and danny-avila:main in api/server/index.js 45:54 * Delete e -i HEAD~2
56 lines
2.1 KiB
JavaScript
56 lines
2.1 KiB
JavaScript
const request = require('supertest');
|
|
const express = require('express');
|
|
const routes = require('../');
|
|
const app = express();
|
|
app.use('/api/config', routes.config);
|
|
|
|
afterEach(() => {
|
|
delete process.env.APP_TITLE;
|
|
delete process.env.GOOGLE_CLIENT_ID;
|
|
delete process.env.GOOGLE_CLIENT_SECRET;
|
|
delete process.env.OPENID_CLIENT_ID;
|
|
delete process.env.OPENID_CLIENT_SECRET;
|
|
delete process.env.OPENID_ISSUER;
|
|
delete process.env.OPENID_SESSION_SECRET;
|
|
delete process.env.OPENID_BUTTON_LABEL;
|
|
delete process.env.OPENID_AUTH_URL;
|
|
delete process.env.GITHUB_CLIENT_ID;
|
|
delete process.env.GITHUB_CLIENT_SECRET;
|
|
delete process.env.DOMAIN_SERVER;
|
|
delete process.env.ALLOW_REGISTRATION;
|
|
});
|
|
|
|
//TODO: This works/passes locally but http request tests fail with 404 in CI. Need to figure out why.
|
|
|
|
// eslint-disable-next-line jest/no-disabled-tests
|
|
describe.skip('GET /', () => {
|
|
it('should return 200 and the correct body', async () => {
|
|
process.env.APP_TITLE = 'Test Title';
|
|
process.env.GOOGLE_CLIENT_ID = 'Test Google Client Id';
|
|
process.env.GOOGLE_CLIENT_SECRET = 'Test Google Client Secret';
|
|
process.env.OPENID_CLIENT_ID= 'Test OpenID Id';
|
|
process.env.OPENID_CLIENT_SECRET= 'Test OpenID Secret';
|
|
process.env.OPENID_ISSUER= 'Test OpenID Issuer';
|
|
process.env.OPENID_SESSION_SECRET= 'Test Secret';
|
|
process.env.OPENID_BUTTON_LABEL= 'Test OpenID';
|
|
process.env.OPENID_AUTH_URL= 'http://test-server.com';
|
|
process.env.GITHUB_CLIENT_ID = 'Test Github client Id';
|
|
process.env.GITHUB_CLIENT_SECRET= 'Test Github client Secret';
|
|
process.env.DOMAIN_SERVER = 'http://test-server.com';
|
|
process.env.ALLOW_REGISTRATION = 'true';
|
|
|
|
const response = await request(app).get('/');
|
|
|
|
expect(response.statusCode).toBe(200);
|
|
expect(response.body).toEqual({
|
|
appTitle: 'Test Title',
|
|
googleLoginEnabled: true,
|
|
openidLoginEnabled: true,
|
|
openidLabel: 'Test OpenID',
|
|
openidImageUrl: 'http://test-server.com',
|
|
githubLoginEnabled: true,
|
|
serverDomain: 'http://test-server.com',
|
|
registrationEnabled: 'true',
|
|
});
|
|
});
|
|
});
|