mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-09-21 21:50:49 +02:00
Fix: Azure "user_provided" Frontend Credentials and Save Last Selected Bing Settings (#587)
* fix(Messages.jsx): fix <body> tag warning * fix(NewConversationMenu): update localStorage with lastBingSettings when endpoint is 'bingAI' fix(getDefaultConversation): retrieve lastBingSettings from localStorage and use it to set default values for jailbreak and toneStyle when endpoint is 'bingAI' feat(settings.spec.js): add test to check if the active class is set on the selected endpoint in the settings menu * fix(BingAIOptions): add data-testid to BingAIOptions SelectDropDown component fix(settings.spec.js): update test to include additional steps for testing settings persistence * fix(azure): support user_provided credentials from client
This commit is contained in:
parent
04e4259005
commit
75250f3a5f
7 changed files with 76 additions and 15 deletions
49
e2e/specs/settings.spec.js
Normal file
49
e2e/specs/settings.spec.js
Normal file
|
@ -0,0 +1,49 @@
|
|||
import { expect, test } from '@playwright/test';
|
||||
|
||||
test.describe('Settings suite', () => {
|
||||
test('Last Bing settings', async ({ page }) => {
|
||||
await page.goto('http://localhost:3080/');
|
||||
const newTopicButton = await page.getByRole('button', { name: 'New Topic' });
|
||||
await newTopicButton.click();
|
||||
|
||||
// includes the icon + endpoint names in obj property
|
||||
const endpointItem = await page.getByRole('menuitemradio', { name: 'BingAI Bing' })
|
||||
await endpointItem.click();
|
||||
|
||||
await page.getByTestId('text-input').click();
|
||||
const button1 = await page.getByRole('button', { name: 'Mode: BingAI' });
|
||||
const button2 = await page.getByRole('button', { name: 'Mode: Sydney' });
|
||||
|
||||
try {
|
||||
await button1.click({ timeout: 100});
|
||||
} catch (e) {
|
||||
// console.log('Bing button', e);
|
||||
}
|
||||
|
||||
try {
|
||||
await button2.click({ timeout: 100});
|
||||
} catch (e) {
|
||||
// console.log('Sydney button', e);
|
||||
}
|
||||
await page.getByRole('option', { name: 'Sydney' }).click();
|
||||
await page.getByRole('tab', { name: 'Balanced' }).click();
|
||||
|
||||
// Change Endpoint to see if settings will persist
|
||||
await newTopicButton.click();
|
||||
await page.getByRole('menuitemradio', { name: 'ChatGPT OpenAI' }).click();
|
||||
|
||||
// Close endpoint menu & re-select BingAI
|
||||
await page.getByTestId('text-input').click();
|
||||
await newTopicButton.click();
|
||||
await endpointItem.click();
|
||||
|
||||
// Check if the settings persisted
|
||||
const localStorage = await page.evaluate(() => window.localStorage);
|
||||
const lastBingSettings = JSON.parse(localStorage.lastBingSettings);
|
||||
const { jailbreak, toneStyle } = lastBingSettings;
|
||||
expect(jailbreak).toBeTruthy();
|
||||
expect(toneStyle).toEqual('balanced');
|
||||
const button = await page.getByRole('button', { name: 'Mode: Sydney' });
|
||||
expect((button).count()).toBeTruthy();
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue