diff --git a/packages/gitbook/e2e/internal.spec.ts b/packages/gitbook/e2e/internal.spec.ts index 53903e5e18..18ce044678 100644 --- a/packages/gitbook/e2e/internal.spec.ts +++ b/packages/gitbook/e2e/internal.spec.ts @@ -168,6 +168,13 @@ const searchTestCases: Test[] = [ await page.keyboard.press('ControlOrMeta+I'); await expect(page.getByTestId('ai-chat')).toBeVisible(); await expect(page.getByTestId('ai-chat-input')).toBeFocused(); + // Override text content for visual consistency in screenshots + await page.evaluate(() => { + const greeting = document.querySelector('[data-testid="ai-chat-time-greeting"]'); + if (greeting) { + greeting.textContent = 'Good morning'; + } + }); }, }, { @@ -182,6 +189,13 @@ const searchTestCases: Test[] = [ await page.getByTestId('ai-chat-button').click(); await expect(page.getByTestId('ai-chat')).toBeVisible(); await expect(page.getByTestId('ai-chat-input')).toBeFocused(); + // Override text content for visual consistency in screenshots + await page.evaluate(() => { + const greeting = document.querySelector('[data-testid="ai-chat-time-greeting"]'); + if (greeting) { + greeting.textContent = 'Good morning'; + } + }); }, }, { @@ -196,6 +210,13 @@ const searchTestCases: Test[] = [ await expect(page.getByTestId('search-input')).toBeEmpty(); await expect(page.getByTestId('ai-chat')).toBeVisible(); await expect(page.getByTestId('ai-chat-input')).toBeFocused(); + // Override text content for visual consistency in screenshots + await page.evaluate(() => { + const greeting = document.querySelector('[data-testid="ai-chat-time-greeting"]'); + if (greeting) { + greeting.textContent = 'Good morning'; + } + }); }, }, { diff --git a/packages/gitbook/src/components/AIChat/AIChat.tsx b/packages/gitbook/src/components/AIChat/AIChat.tsx index a59a477567..aa3ca9787e 100644 --- a/packages/gitbook/src/components/AIChat/AIChat.tsx +++ b/packages/gitbook/src/components/AIChat/AIChat.tsx @@ -229,6 +229,7 @@ export function AIChatBody(props: {