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

+21 -1
View File
@@ -15,7 +15,7 @@ const certificates = certificatesListResponseSchema.parse({ failures: [], certif
daysLeft: 300 + i, keySize: 2048, usage: ["server"], trusted: true, status: "valid",
})) })
const backups: BackupItem[] = ids.map(i => ({ id: String(i), serverId: 1, serverName: "Тестовый роутер",
filename: `backup-${i}.backup`, sizeBytes: i === 12 ? 1048576 : i * 1024, createdAt: "2026-09-14T00:00:00Z", kind: "manual" }))
filename: `backup-${i}.backup`, sizeBytes: i === 12 ? 1048576 : i * 1024, createdAt: "2026-09-14T00:00:00Z", kind: i > 6 ? "auto" : "manual" }))
async function setup(page: Page, url: string) {
await page.route("**/health", route => route.fulfill({ json: { ok: true } }))
@@ -70,3 +70,23 @@ test("Бэкапы: 12 строк, числовая сортировка и вы
await page.getByRole("button", { name: "Отмена", exact: true }).click()
await expect(rows).toHaveCount(12)
})
test("Бэкапы FilterQuery: тип, изменение значения и сброс", async ({ page }) => {
await setup(page, "/backups")
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: "авто", exact: true }).click()
await expect(rows).toHaveCount(6)
await expect(page.locator('tr[data-row-id="12"]')).toBeVisible()
await expect(page.locator('tr[data-row-id="1"]')).toHaveCount(0)
await page.getByRole("button", { name: "авто", exact: true }).click()
await page.getByRole("option", { name: "вручную", exact: true }).click()
await expect(rows).toHaveCount(6)
await expect(page.locator('tr[data-row-id="1"]')).toBeVisible()
await expect(page.locator('tr[data-row-id="12"]')).toHaveCount(0)
await page.getByRole("button", { name: "Очистить", exact: true }).click()
await expect(rows).toHaveCount(12)
})