Skip to content

Commit c9345ce

Browse files
committed
fix(docs): cover ToC hover color and underline invariants
1 parent 47dab6f commit c9345ce

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

‎apps/docs/scripts/test-navigation-e2e.ts‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1508,13 +1508,29 @@ try {
15081508
.poll(() => link.evaluate((element) => getComputedStyle(element).textDecorationLine))
15091509
.toBe('underline')
15101510
const next = toc.getByRole('link', { name: 'Next steps', exact: true })
1511+
const color = await next.evaluate((element) => getComputedStyle(element).color)
15111512
await next.hover()
15121513
await next.evaluate((element) =>
15131514
Promise.all(element.getAnimations().map((animation) => animation.finished))
15141515
)
15151516
await expect
15161517
.poll(() => next.evaluate((element) => getComputedStyle(element).backgroundColor))
15171518
.toBe('rgba(0, 0, 0, 0)')
1519+
await expect(next).toHaveCSS('color', color)
1520+
await expect(next).toHaveCSS('text-decoration-line', 'none')
1521+
await expect
1522+
.poll(() =>
1523+
toc
1524+
.getByRole('link')
1525+
.filter({ visible: true })
1526+
.evaluateAll(
1527+
(links) =>
1528+
links.filter((element) =>
1529+
getComputedStyle(element).textDecorationLine.includes('underline')
1530+
).length
1531+
)
1532+
)
1533+
.toBe(1)
15181534
await page.screenshot({ path: join(directory, `toc-hover-${theme}.png`) })
15191535
}
15201536
} finally {

0 commit comments

Comments
 (0)