${this.isChatStarted
? html`
-
@@ -106,6 +219,9 @@ const Chat = () => {
onRenderFooterContent={() => setIsConfigPanelOpen(false)}>Close}
isFooterAtBottom={true}
>
+
+
+
{
onChange={onUseStreamChange}
/>
+
+ setIsChatStylesAccordionOpen(!isChatStylesAccordionOpen)}
+ />
+ {isChatStylesAccordionOpen && (
+ <>
+
+
+
+ >
+ )}
+
+
+
+
);
diff --git a/tests/e2e/webapp.spec.ts b/tests/e2e/webapp.spec.ts
index ee1acf8a..54a0042a 100644
--- a/tests/e2e/webapp.spec.ts
+++ b/tests/e2e/webapp.spec.ts
@@ -438,6 +438,8 @@ test.describe('generate answer', () => {
test('follow up questions', async ({ page }) => {
const followupQuestions = page.getByTestId('followUpQuestion');
+ await followupQuestions.waitFor();
+
await expect(followupQuestions).toHaveCount(3);
const chatInput = page.getByTestId('question-input');
@@ -471,6 +473,44 @@ test.describe('developer settings', () => {
await expect(page.getByLabel('Retrieval mode')).toContainText('Vectors + Text (Hybrid)');
});
+ test('enable branding toggled', async ({ page }) => {
+ await page.goto('/');
+ await page.getByTestId('button__developer-settings').click();
+ // toggle enable branding
+ await page.locator('label').filter({ hasText: 'Enable branding' }).click();
+ await page.waitForTimeout(1000);
+ // await for brading to be visible
+ await expect(page.getByTestId('chat-branding')).toBeVisible();
+ });
+
+ test('select dark theme', async ({ page }) => {
+ await page.goto('/');
+ expect(await page.getAttribute('html', 'data-theme')).toBe('');
+ await page.getByTestId('button__developer-settings').click();
+ await page.locator('label').filter({ hasText: 'Select theme' }).click();
+ // Wait for the state to update
+ await page.waitForFunction(() => {
+ return document.querySelector('html')?.dataset.theme === 'dark';
+ });
+ // Check the updated state
+ expect(await page.getAttribute('html', 'data-theme')).toBe('dark');
+ });
+
+ test('customize chat styles toggled and check localStorage', async ({ page }) => {
+ await page.goto('/');
+ await page.getByTestId('button__developer-settings').click();
+ await page.locator('label').filter({ hasText: 'Customize chat styles' }).click();
+
+ await page.waitForTimeout(1000);
+ // check if localStorage has an item called 'customStyles' and it's not empty
+ const hasCustomStyles = await page.evaluate(() => {
+ const customStyles = localStorage.getItem('ms-azoaicc:customStyles');
+ return customStyles !== null && customStyles.trim() !== '';
+ });
+
+ await expect(hasCustomStyles).toBe(true);
+ });
+
test('handle no stream parsing', async ({ page }) => {
await page.goto('/');
await page.getByTestId('default-question').nth(0).click();