Files
MikrotikManager/tests/e2e/gre-pools.spec.ts
T

22 lines
1.4 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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)
})