Skip to content

Commit c23d134

Browse files
committed
Fix failing visual test
1 parent a133393 commit c23d134

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

tests/intro_visual.spec.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,17 @@ test.describe('Intro page visual validation @visual', () => {
88
});
99

1010
test('intro-page', async ({page}) => {
11+
// Wait for the async changelog content to load so React doesn't
12+
// overwrite our placeholder after we inject it.
13+
await page.waitForFunction(() => {
14+
const headers = Array.from(document.querySelectorAll('h3'));
15+
const whatsNew = headers.find((h) =>
16+
h.textContent?.includes("What's new"),
17+
);
18+
const span = whatsNew?.nextElementSibling;
19+
return span && span.innerHTML.trim() !== '';
20+
});
21+
1122
// Clean dynamic elements right before snapping the screenshot.
1223
await page.evaluate(() => {
1324
// 1. Overwrite dynamic footer versioning.

0 commit comments

Comments
 (0)