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)
})