test(connections): export CSV only after the filter applies

The search filter reaches the list through a deferred value, so clicking Export right after typing could export all 1000 rows (CI got 1001 lines, expected 151). The test now waits until the grid reports the 150 matching rows before exporting.
This commit is contained in:
Zakk committed 2026-09-25 23:09:34 +10:00
1 parent ca2b5be0fe
commit f1068781ee
1 file changed
+3
+3
View File
@@ -328,6 +328,9 @@ test('phone details retain routing diagnostics and omit unsupported flow actions
test('the connection list exports the filtered rows as CSV', async ({page}) => {
await page.goto('/#/connections?tab=list');
await page.locator('.rp-toolbar input').fill('api.telegram.org');
// The filter applies through a deferred value; export only once the list shows the 150 matches and its header.
const grid = page.getByRole('grid', {name: 'Connections'}).or(page.getByRole('treegrid', {name: 'Connections'}));
await expect(grid).toHaveAttribute('aria-rowcount', '151');
const download = page.waitForEvent('download');
await page.getByRole('button', {name: 'Export CSV', exact: true}).click();
const file = await download;