fix(ui): подключить фильтры статистики с проверкой срезов

This commit is contained in:
Denozordec committed 2026-09-14 22:27:12 +07:00
1 parent 52af82af42
commit 4fd844f977
5 files changed
+72 -37

No files matched your search

+21
View File
@@ -107,4 +107,25 @@ test("Статистика: CompactDataGrid сохраняет 12 строк, с
await expect(rows.first()).toContainText("Пользователь 12")
await rows.first().click()
await expect(page).toHaveURL(/userId=user-12/)
await expect(page.getByRole("button", { name: "user-12", exact: true })).toBeVisible()
await page.getByRole("button", { name: "user-12", exact: true }).click()
await page.getByPlaceholder("id пользователя").fill("user-2")
await page.getByPlaceholder("id пользователя").press("Enter")
await expect(page).toHaveURL(/userId=user-12/)
await page.getByRole("button", { name: "Применить срез", exact: true }).click()
await expect(page).toHaveURL(/userId=user-2/)
await page.getByRole("button", { name: "Очистить", exact: true }).click()
await expect(page).toHaveURL(/userId=user-2/)
await page.getByRole("button", { name: "Применить срез", exact: true }).click()
await expect(page).not.toHaveURL(/userId=/)
await page.goto("/statistics?from=2026-09-01&to=2026-09-13&country=RU")
await page.getByRole("button", { name: "RU", exact: true }).click()
await page.getByPlaceholder("ISO, напр. US").fill("RUS")
await page.getByPlaceholder("ISO, напр. US").press("Enter")
await expect(page.getByRole("alert").filter({ hasText: "Укажите двухбуквенный код страны." })).toBeVisible()
await expect(page.getByRole("button", { name: "Применить срез", exact: true })).toBeDisabled()
await expect(page).toHaveURL(/country=RU(?:&|$)/)
await page.evaluate(() => window.history.pushState(null, "", "/statistics?country=DE"))
await expect(page.getByRole("button", { name: "DE", exact: true })).toBeVisible()
await expect(page.getByText("Укажите двухбуквенный код страны.", { exact: true })).toHaveCount(0)
})