test(e2e): wait for the zone page after an import apply

This commit is contained in:
bryanpedini committed 2026-11-19 15:46:12 +01:00
1 parent 1cafcc759e
commit 5d7da681e7
1 file changed
+8
+8
View File
@@ -579,8 +579,16 @@ export class Ui {
result = { status: response.status(), json: await response.json() };
await route.fulfill({ response });
}, { times: 1 });
const navigated = this.page
.waitForURL((url) => /^\/zones\/[^/]+$/.test(url.pathname), { waitUntil: 'load' })
.then(() => true, () => false);
await this.submitAndWait('POST', path, () => this.page.click('#import-apply'));
if (!result) throw new Error('no import apply response');
if (result.status === 200) {
if (!(await navigated)) throw new Error('import apply did not return to the zone page');
await expect(this.page.locator('#records-status')).not.toHaveText('Loading records...');
await this.settle();
}
return result;
}