fix(ui): перенести фильтры BGP и бэкапов на FilterQuery

This commit is contained in:
Denozordec committed 2026-09-14 22:09:48 +07:00
1 parent a475b5c6df
commit fca42aaa81
11 files changed
+103 -34

No files matched your search

+20 -1
View File
@@ -15,7 +15,7 @@ const ospf = {
}
const bgp = ids.map(i => ({ ...host, id: String(i), name: `Пир ${i}`, peerIp: `192.0.2.${i}`,
remoteAs: 65000 + i, localAs: 64512, localId: "192.0.2.100", remoteId: `192.0.2.${i}`,
state: "Established", type: "eBGP", uptime: "1h", holdTime: 90, keepalive: 30,
state: i > 6 ? "Active" : "Established", type: "eBGP", uptime: "1h", holdTime: 90, keepalive: 30,
prefixesRx: i, prefixesTx: i, inputMessages: i, outputMessages: i, capabilities: ["route-refresh"], lastError: null }))
async function setup(page: Page, path: string, empty = false) {
@@ -72,3 +72,22 @@ test("Пустые ответы API показывают пустые состо
await expect(page.getByText(message, { exact: true })).toBeVisible()
}
})
test("BGP FilterQuery: выбор, AND и сброс", async ({ page }) => {
await setup(page, "/bgp")
const rows = page.locator("tr[data-row-id]")
await expect(rows).toHaveCount(12)
await page.getByRole("button", { name: "Фильтры", exact: true }).click()
await page.getByRole("option", { name: "Состояние", exact: true }).click()
await page.getByRole("option", { name: "равно", exact: true }).click()
await page.getByRole("option", { name: "Active", exact: true }).click()
await expect(rows).toHaveCount(6)
await expect(rows.first()).toContainText("Пир 7")
await page.getByRole("button", { name: "Фильтры", exact: true }).click()
await page.getByRole("option", { name: "Тип", exact: true }).click()
await page.getByRole("option", { name: "равно", exact: true }).click()
await page.getByRole("option", { name: "iBGP", exact: true }).click()
await expect(rows).toHaveCount(0)
await page.getByRole("button", { name: "Очистить", exact: true }).click()
await expect(rows).toHaveCount(12)
})