Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions packages/gitbook/e2e/internal.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.querySelectorAll('[data-testid="ai-chat-time-greeting"]');
greeting.forEach((greeting) => {
greeting.textContent = 'Good morning';
});
});
},
},
{
Expand All @@ -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.querySelectorAll('[data-testid="ai-chat-time-greeting"]');
greeting.forEach((greeting) => {
greeting.textContent = 'Good morning';
});
});
},
},
{
Expand All @@ -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.querySelectorAll('[data-testid="ai-chat-time-greeting"]');
greeting.forEach((greeting) => {
greeting.textContent = 'Good morning';
});
});
},
},
{
Expand Down
1 change: 1 addition & 0 deletions packages/gitbook/src/components/AIChat/AIChat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ export function AIChatBody(props: {
<h5
className="animate-blur-in-slow font-bold text-lg text-tint-strong [@container(min-height:400px)]:text-center"
style={{ animationDelay: '.5s' }}
data-testid="ai-chat-time-greeting"
>
{timeGreeting}
</h5>
Expand Down