fix(ui): перенести таблицу рекурсивных маршрутов на ReUI v9
This commit is contained in:
1 parent
ddf1851e92
commit
1ea07f65b2
3 files changed
+54
-13
No files matched your search
@@ -0,0 +1,33 @@
|
||||
import { test, expect } from "@playwright/test"
|
||||
|
||||
test("Рекурсивные маршруты: все группы и раскрытие после сортировки", async ({ page }) => {
|
||||
const errors: string[] = []
|
||||
page.on("pageerror", error => errors.push(error.message))
|
||||
const routes = Array.from({ length: 12 }, (_, i) => ({
|
||||
id: String(i + 1), dstAddress: `10.0.${i + 1}.0/24`, gateway: `192.0.2.${i + 1}`,
|
||||
distance: 1, scope: 30, targetScope: 10, routingTable: "main", checkGateway: "ping",
|
||||
comment: `Маршрут ${i + 1}`, disabled: false, country: "RU",
|
||||
}))
|
||||
await page.route("**/health", route => route.fulfill({ json: { ok: true } }))
|
||||
await page.route("**/api/**", route => {
|
||||
const path = new URL(route.request().url()).pathname
|
||||
return route.fulfill({ json: path === "/api/recursive-routes" ? { routes }
|
||||
: path === "/api/recursive-routes/gateways" ? { gateways: [] }
|
||||
: path === "/api/auth/config" ? { required: false }
|
||||
: path === "/api/servers" ? [{ id: 1, name: "Роутер", host: "192.0.2.100", type: "exit-node", site: "TEST", country: "RU", asn: "64512", enabled: true, status: "online", latency: 1 }]
|
||||
: path === "/api/evobgp/settings" ? { enabled: false, baseUrl: "", secretConfigured: false } : {} })
|
||||
})
|
||||
await page.goto("/recursive-routes")
|
||||
const rows = page.locator("tr[data-row-id]")
|
||||
await expect(rows).toHaveCount(12)
|
||||
await page.getByRole("button", { name: "Route / Comment", exact: true }).click()
|
||||
await expect(rows.first()).toContainText("10.0.1.0/24")
|
||||
await page.getByRole("button", { name: "Route / Comment", exact: true }).click()
|
||||
await expect(rows.first()).toContainText("10.0.12.0/24")
|
||||
await rows.first().click()
|
||||
await expect(page.getByText("Endpoint 1", { exact: true })).toBeVisible()
|
||||
await expect(page.getByText("check: ping", { exact: true })).toBeVisible()
|
||||
await rows.first().click()
|
||||
await expect(page.getByText("Endpoint 1", { exact: true })).toBeHidden()
|
||||
expect(errors).toEqual([])
|
||||
})
|
||||
Reference in new issue
Block a user