fix(ui): убрать неподтверждённые данные и действия GRE-пулов

This commit is contained in:
Denozordec committed 2026-09-30 16:10:21 +07:00
1 parent 337d14abdf
commit fc3d588cec
6 files changed
+55 -139

No files matched your search

+21
View File
@@ -0,0 +1,21 @@
import { test, expect } from "@playwright/test"
test("GRE: mock-пулы только для просмотра без фиктивного создания", async ({ page }) => {
let writes = 0
await page.route("**/health", r => r.fulfill({ json: { ok: true } }))
await page.route("**/api/**", r => {
if (r.request().method() !== "GET") writes++
return r.fulfill({ json: new URL(r.request().url()).pathname === "/api/auth/config" ? { required: false } : {} })
})
await page.goto("/settings")
await page.getByRole("button", { name: "Моковые", exact: true }).click()
await page.getByRole("link", { name: /^GRE/ }).click()
await expect(page.getByRole("group", { name: "Свежесть GRE" })).toContainText("не получены с RouterOS")
await page.getByRole("button", { name: "IP-пулы", exact: true }).click()
await expect(page.getByText("Моковый каталог · только просмотр", { exact: true })).toBeVisible()
expect(await page.locator("tr[data-row-id]").count()).toBeGreaterThan(0)
await expect(page.getByRole("button", { name: "Добавить пул", exact: true })).toHaveCount(0)
await expect(page.getByRole("button", { name: "Создать пул", exact: true })).toHaveCount(0)
await expect(page.getByRole("menuitem", { name: "Удалить пул", exact: true })).toHaveCount(0)
expect(writes).toBe(0)
})
+4 -7
View File
@@ -40,7 +40,7 @@ test("IPsec: 12 клиентов, сортировка, выбор удален
await expect(rows).toHaveCount(1)
})
test("GRE: 12 туннелей и пулов, числовая сортировка и поиск", async ({ page }) => {
test("GRE: 12 туннелей, числовая сортировка и достоверность пулов", async ({ page }) => {
const errors: string[] = []
page.on("pageerror", e => errors.push(e.message))
await setup(page, "/gre")
@@ -52,11 +52,8 @@ test("GRE: 12 туннелей и пулов, числовая сортиров
await expect(rows).toHaveCount(1)
await page.getByPlaceholder("Поиск по имени, IP…").fill("")
await page.getByRole("button", { name: "IP-пулы", exact: true }).click()
await expect(rows).toHaveCount(12)
await page.getByRole("button", { name: "Имя пула", exact: true }).click()
await expect(rows.first()).toContainText("pool-1")
await page.getByRole("button", { name: "Имя пула", exact: true }).click()
await expect(rows.first()).toContainText("pool-12")
await expect(rows).toHaveCount(0)
await expect(page.getByRole("status").filter({ hasText: "Каталог пулов, CIDR и свободная ёмкость не предоставляются" })).toBeVisible()
expect(errors).toEqual([])
})
@@ -66,5 +63,5 @@ test("Пустые ответы IPsec и GRE", async ({ page }) => {
await page.goto("/gre")
await expect(page.getByText("Нет GRE-туннелей", { exact: true })).toBeVisible()
await page.getByRole("button", { name: "IP-пулы", exact: true }).click()
await expect(page.getByText("Нет IP-пулов", { exact: true })).toBeVisible()
await expect(page.getByRole("status").filter({ hasText: "Каталог пулов, CIDR и свободная ёмкость не предоставляются" })).toBeVisible()
})