Skip to content

Commit 709205f

Browse files
committed
Prevent flaky tests in AI Chat followup suggestions
1 parent 0f4c53c commit 709205f

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

packages/gitbook/e2e/internal.spec.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,15 @@ const searchTestCases: Test[] = [
146146
await expect(page.getByTestId('ai-chat-followup-suggestion')).toHaveCount(3, {
147147
timeout: 60_000,
148148
});
149+
// Override text content for visual consistency in screenshots
150+
await page.evaluate(() => {
151+
const suggestions = document.querySelectorAll(
152+
'[data-testid="ai-chat-followup-suggestion"]'
153+
);
154+
suggestions.forEach((suggestion) => {
155+
suggestion.textContent = 'Follow-up suggestion';
156+
});
157+
});
149158
},
150159
},
151160
{
@@ -205,6 +214,15 @@ const searchTestCases: Test[] = [
205214
await expect(page.getByTestId('ai-chat-followup-suggestion')).toHaveCount(3, {
206215
timeout: 60_000,
207216
});
217+
// Override text content for visual consistency in screenshots
218+
await page.evaluate(() => {
219+
const suggestions = document.querySelectorAll(
220+
'[data-testid="ai-chat-followup-suggestion"]'
221+
);
222+
suggestions.forEach((suggestion) => {
223+
suggestion.textContent = 'Follow-up suggestion';
224+
});
225+
});
208226
},
209227
},
210228
];

0 commit comments

Comments
 (0)