chore(test): проверить отказ большого каталога проб

This commit is contained in:
Denozordec committed 2026-10-04 04:22:25 +07:00
1 parent e5cf05759e
commit 5488d86b12
5 files changed
+30 -2

No files matched your search

+11 -1
View File
@@ -76,7 +76,7 @@ test("Демо-расписание: сортировка интервала и
test("Large speed probes: 50 строк, глобальная сортировка и контекст обновления", async ({ page }, info) => {
test.setTimeout(90000)
const start = Date.now()
await setup(page, "/probes", 1000)
const writes = await setup(page, "/probes", 1000)
await page.getByRole("button", { name: "Расписание", exact: true }).click()
const rows = page.locator("tr[data-row-id]")
await expect(rows).toHaveCount(50)
@@ -97,12 +97,22 @@ test("Large speed probes: 50 строк, глобальная сортировк
for (let i = 0; i < 3; i++) await page.getByRole("button", { name: "…", exact: true }).last().click()
await page.getByRole("button", { name: "Перейти на страницу 20", exact: true }).click()
await expect(page.getByText("951–1000 из 1000", { exact: true })).toBeVisible()
const panel = page.getByRole("region", { name: "Пробы скорости", exact: true })
const freshness = await panel.getByRole("status").textContent()
await page.route("**/api/uptime/speed-probes", route => route.fulfill({ status: 503, json: { error: "Большой каталог недоступен" } }))
await panel.getByRole("button", { name: "Обновить пробы скорости", exact: true }).click()
await expect(panel.getByRole("alert")).toContainText("Показан последний успешный список")
await expect(panel.getByRole("status")).toHaveText(freshness!)
await expect(rows).toHaveCount(50)
await expect(page.getByText("951–1000 из 1000", { exact: true })).toBeVisible()
await page.setViewportSize({ width: 320, height: 900 })
expect(await page.evaluate(() => document.documentElement.scrollWidth <= innerWidth)).toBe(true)
await page.route("**/api/uptime/speed-probes", route => route.fulfill({ json: { probes: [{ id: "1", srcServerId: "1", dstServerId: "1001", srcInterface: "ether1", dstInterface: "ether1", protocol: "tcp", direction: "both", durationSec: "10", enabled: true, lastRunAt: null, lastTxAvgMbps: null, lastRxAvgMbps: null, lastStatus: null, lastError: null }] } }))
await page.getByRole("button", { name: "Обновить пробы скорости", exact: true }).click()
await expect(rows).toHaveCount(1)
await expect(rows.first()).toHaveAttribute("data-row-id", "1")
await expect(panel.getByRole("alert")).toHaveCount(0)
expect(writes).toEqual([])
})
for (const theme of ["dark", "light"]) test(`Large server rail: URL, страницы, поиск и клавиатура на1001 устройстве/${theme}`, async ({ page }, info) => {