fix(ui): проверять подтверждение восстановления сетевых настроек

This commit is contained in:
Denozordec committed 2026-09-29 13:58:26 +07:00
1 parent d0f5649725
commit 3dd4ad34ee
9 files changed
+33 -8

No files matched your search

+9 -1
View File
@@ -19,6 +19,8 @@ for (const section of ["wireguard", "ipsec", "gre", "firewall", "filters", "recu
await gate
return route.fulfill({ status: 403, json: { error: "Восстановление запрещено тест" } })
}
if (attempts === 2) return route.fulfill({ json: { ok: false, routes: [], rules: [] } })
if (attempts === 3) return route.fulfill({ json: {} })
return route.fulfill({ json: { ok: true, routes: [], rules: [] } })
}
const json = path.endsWith("/revisions") ? { revisions: [{ id: "rev/1", serverId: "1", section, source: "apply", fingerprint: "fixture", createdAt: "2026-09-29T00:00:00Z", note: null, itemCount: 1 }] }
@@ -49,9 +51,15 @@ for (const section of ["wireguard", "ipsec", "gre", "firewall", "filters", "recu
release!()
await expect(dialog.getByRole("alert").filter({ hasText: "Восстановление запрещено тест" })).toBeVisible()
await expect(dialog.getByRole("button", { name: "Откатить", exact: true })).toBeEnabled()
for (let i = 0; i < 2; i++) {
await dialog.getByRole("button", { name: "Откатить", exact: true }).click()
await expect.poll(() => attempts).toBe(i + 2)
await expect(dialog.getByRole("alert").filter({ hasText: "Сервер не подтвердил восстановление" })).toBeVisible()
await expect(page.getByText("Версия применена на роутер", { exact: true })).toHaveCount(0)
}
await dialog.getByRole("button", { name: "Откатить", exact: true }).click()
await expect(dialog).toHaveCount(0)
expect(attempts).toBe(2)
expect(attempts).toBe(4)
await sheet.getByRole("button", { name: "Откатить", exact: true }).click()
await expect(dialog.getByText("Восстановление запрещено тест")).toHaveCount(0)
await page.keyboard.press("Escape")