MCPcopy Create free account
hub / github.com/adobe/react-spectrum / verifyTableRows

Function verifyTableRows

perf/drivers.mjs:231–245  ·  view source on GitHub ↗
({page, size, action})

Source from the content-addressed store, hash-verified

229 ]);
230
231async function verifyTableRows({page, size, action}) {
232 let expected = (action.expected ?? records)(size);
233 let rows = await page.locator('.data-table [data-record]').evaluateAll(rows =>
234 rows.map(row => ({
235 id: row.getAttribute('data-record'),
236 name: row.querySelector('[role="rowheader"]')?.textContent
237 }))
238 );
239 if (
240 rows.length !== expected.length ||
241 rows.some((row, i) => row.id !== expected[i] || row.name !== recordLabel(expected[i]))
242 ) {
243 throw new Error('The table did not retain the expected row order and content.');
244 }
245}
246
247const filtered = size => records(size).filter(id => id.includes('9'));
248const dataRows = (expected, direction) => [

Callers

nothing calls this directly

Calls 1

recordLabelFunction · 0.85

Tested by

no test coverage detected