Improve timestamp handling and event navigation

This commit is contained in:
Stanislav Rossovskii
2026-05-27 11:01:27 +04:00
parent edc51e9c59
commit 71f0035b0b
37 changed files with 485 additions and 109 deletions

View File

@@ -19,6 +19,12 @@ test("agents list links to detail", async ({ page }) => {
await expect(page.locator("thead")).toContainText("↓");
await expect(page.locator("body")).toContainText("checks 2");
await expect(page.locator("body")).toContainText("warn 1");
await expect(page.getByRole("button", { name: /Timezone: default/ })).toBeVisible();
await page.getByRole("button", { name: /Timezone: default/ }).click();
await expect(page.getByRole("button", { name: /Timezone: browser/ })).toBeVisible();
await page.getByRole("button", { name: /Timezone: browser/ }).click();
await expect(page.getByRole("button", { name: /Timezone: utc \(UTC\)/ })).toBeVisible();
await expect(page.locator("tbody")).toContainText("UTC");
await page.getByPlaceholder("search agent").fill("host-1");
await expect(page).toHaveURL(/\/agents$/);
await expect(page.locator("tbody")).toContainText("host-1");
@@ -45,6 +51,8 @@ test("checks page lists rows", async ({ page }) => {
await page.goto("/checks");
await expect(page.locator("body")).toContainText("disk");
await expect(page.locator("body")).toContainText("load");
await page.getByRole("link", { name: "disk" }).click();
await expect(page).toHaveURL(/\/events\?agent_id=agent-1&check_id=disk$/);
});
test("incidents filter renders", async ({ page }) => {
@@ -53,8 +61,11 @@ test("incidents filter renders", async ({ page }) => {
});
test("events page", async ({ page }) => {
await page.goto("/events");
await page.goto("/events?agent_id=agent-1&check_id=disk");
await expect(page.getByRole("heading", { name: "Events" })).toBeVisible();
await expect(page.getByRole("button", { name: "query" })).toHaveCount(0);
await expect(page.getByRole("link", { name: /agent_id=.*agent-1/ })).toBeVisible();
await expect(page.getByRole("link", { name: /check_id=.*disk/ })).toBeVisible();
});
test("outbox page", async ({ page }) => {