| 251 | ]; |
| 252 | |
| 253 | async function verifyColumns({page, size}, expectedWidth) { |
| 254 | let widths = await page.locator('.resizable-table th').evaluateAll(columns => |
| 255 | columns.map(column => ({ |
| 256 | style: parseFloat(column.style.width), |
| 257 | actual: column.getBoundingClientRect().width |
| 258 | })) |
| 259 | ); |
| 260 | if ( |
| 261 | widths.length !== 6 || |
| 262 | widths.some( |
| 263 | width => width.style !== expectedWidth || Math.abs(width.actual - expectedWidth) > 1 |
| 264 | ) |
| 265 | ) { |
| 266 | throw new Error('The table columns did not finish resizing to the expected width.'); |
| 267 | } |
| 268 | await page.getByRole('rowheader', {name: `Record ${size - 1}`, exact: true}).waitFor(); |
| 269 | } |
| 270 | |
| 271 | const resizedRows = (size, width) => [ |
| 272 | condition('.resizable-table [data-record]', {count: size}), |