diff --git a/e2e/harness/ui.ts b/e2e/harness/ui.ts index aaf0448..c1de7f8 100644 --- a/e2e/harness/ui.ts +++ b/e2e/harness/ui.ts @@ -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; }