Problem ReleaseNotesIT#homeListsReleaseNotesAndChanges guards that the "Release Changes" Live Data fits the width of a page, because the table layout scrolls sideways when its columns do not fit and nothing indicates that a column is out of view:
Long overflow = (Long) setup.getDriver().executeJavascript(
"const wrapper = document.querySelector('#releasenoteschanges .layout-table-wrapper');"
+ "return wrapper.scrollWidth - wrapper.clientWidth;");
assertEquals(0L, overflow, "The changes table must fit the width of the page.");
That difference can never be zero. Live Data draws a column resize handle as an absolutely positioned 16px button carrying margin-right: -2px, straddling the right border of the last column header, so about half of it hangs past the right edge of the table and into the scroll extent of .layout-table-wrapper. The handle belongs to every Live Data table and is there whichever columns are displayed. Measured on the application home at viewports where the table fits its container exactly, both the table and the wrapper being 1007.219px wide, scrollWidth - clientWidth is a constant 8. Hiding the header row tr.column-header-names brings it to 0, while hiding the filter row or the table body leaves it at 8. The constant depends on the browser and the colour theme, being 8 on a local instance and 2 in the browser of the Docker functional test, so the assertion holds only where it was written and the test now fails with:
The columns themselves are innocent: the creation date and the summary are hidden with display: none and measure 0px wide with no borders, so they cost no table width, as intended. Proposal Measure the table against its container rather than the scroll extent of the wrapper:
Long overflow = (Long) setup.getDriver().executeJavascript(
"const wrapper = document.querySelector('#releasenoteschanges .layout-table-wrapper');"
+ "const table = wrapper.querySelector('table');"
+ "return Math.max(0, Math.round(table.getBoundingClientRect().width - wrapper.clientWidth));");
This keeps the guard: a column pushed out of view widens the table by tens of pixels, whereas a table that fits reports zero. Measured at three viewports on the application home, the current expression reports 47, 8 and 8, while the proposed one reports 39, 0 and 0, the 39 being a viewport at which the table genuinely does not fit. |