Skip to content

Commit 0bba7e8

Browse files
committed
test(web): bring each header cell into view before reading what is on top of it
1 parent f95d212 commit 0bba7e8

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎cli/tests/entrypoints/web/test_browser_tables.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@
4747
OVER_THE_HEADER = """table => [...table.querySelectorAll("thead th")]
4848
.filter((cell) => cell.getBoundingClientRect().width > 0)
4949
.map((cell) => {
50+
const box = table.closest(".table-scroll");
51+
box.scrollLeft = Math.max(0, cell.offsetLeft - box.clientWidth / 2);
5052
const { left, top, width, height } = cell.getBoundingClientRect();
5153
const found = document.elementFromPoint(left + width / 2, top + height / 2);
5254
return found === cell || cell.contains(found) ? "" : `${cell.textContent}: ${found?.tagName}`;

0 commit comments

Comments
 (0)