fix(ui): учитывать неизвестный статус устройств VPN
This commit is contained in:
1 parent
6f00596e33
commit
6ea3cdad0e
6 files changed
+56
-16
No files matched your search
@@ -0,0 +1,20 @@
|
||||
import { test, expect } from "@playwright/test"
|
||||
|
||||
for (const path of ["ipsec", "vxlan"]) {
|
||||
for (const monitoring of ["null", "missing"]) {
|
||||
test(`${path}: inventory без снимка мониторинга (${monitoring})`, async ({ page }) => {
|
||||
await page.route("**/health", r => r.fulfill({ json: { ok: true } }))
|
||||
await page.route("**/api/**", r => {
|
||||
const url = new URL(r.request().url()).pathname
|
||||
const server = { id: 1, name: "Без первого опроса", host: "192.0.2.1", enabled: true, country: "RU", type: "exit-node", ...(monitoring === "null" ? { status: null, latency: null } : {}) }
|
||||
return r.fulfill({ json: url === "/api/servers" ? [server] : url === "/api/ipsec" ? { servers: [], clients: [] } : url === "/api/vxlan" ? { tunnels: [] } : url === "/api/auth/config" ? { required: false } : {} })
|
||||
})
|
||||
await page.goto("/" + path)
|
||||
const device = page.getByRole("option").filter({ hasText: "Без первого опроса" })
|
||||
await expect(device).toBeVisible()
|
||||
await expect(device).toContainText("Статус неизвестен")
|
||||
await expect(page.getByRole("alert").filter({ hasText: /Некорректный ответ|Не удалось загрузить/ })).toHaveCount(0)
|
||||
await expect(page.getByRole("button", { name: "Обновить", exact: true })).toBeEnabled()
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user