Files
wehub-resource-sync f99010fae1
CI / lint (push) Failing after 1s
CI / frontend (push) Failing after 1s
CI / scripts (push) Failing after 1s
CI / Go Test (ubuntu-latest) (push) Failing after 0s
CI / frontend-node-25 (push) Failing after 1s
CI / docs (push) Failing after 0s
CI / coverage (push) Failing after 0s
CI / e2e (push) Failing after 0s
Docker / build-and-push (push) Failing after 1s
CI / integration (push) Failing after 4m43s
CI / Go Test (windows-latest) (push) Has been cancelled
CI / Desktop Unit Tests (Windows) (push) Has been cancelled
Desktop Artifacts / Desktop Build (Linux (arm64)) (push) Has been cancelled
Desktop Artifacts / Desktop Build (Linux) (push) Has been cancelled
Desktop Artifacts / Desktop Build (Windows) (push) Has been cancelled
Desktop Artifacts (macOS) / Desktop Build (macOS (aarch64)) (push) Has been cancelled
Desktop Artifacts (macOS) / Desktop Build (macOS (x86_64)) (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:30:36 +08:00

61 lines
1.9 KiB
TypeScript

import { test, expect } from "@playwright/test";
import { SessionsPage } from "./pages/sessions-page";
// The fixture marks `test-session-mixed-content-7` (project-beta,
// 7 messages) with termination_status = "tool_call_pending".
// All other fixture sessions have a NULL status.
const UNCLEAN_SESSION_ID = "test-session-mixed-content-7";
test.describe("session termination status", () => {
test("status filter narrows session list to unclean", async ({
page,
}) => {
const sp = new SessionsPage(page);
await sp.goto();
// Open sidebar filters and click the Unclean pill.
await page.locator(".filter-btn").click();
await page
.locator(".filter-dropdown .pill-btn", { hasText: /^Unclean$/ })
.click();
// Active-filter chip surfaces in the AnalyticsPage right pane
// (no session selected).
await expect(
page.getByText(/Status:\s*Unclean/i),
).toBeVisible();
// The fixture has exactly one unclean session.
await expect(sp.sessionItems).toHaveCount(1);
await expect(sp.sessionCount).toHaveText("1 session");
// Surviving session renders the unclean StatusDot.
await expect(
page.locator(".kit-status-dot--unclean").first(),
).toBeVisible();
});
test("Top Sessions table renders unclean status dot", async ({
page,
}) => {
// AnalyticsPage renders inside the right pane on bare "/"
// when no session is selected.
await page.goto("/");
await expect(
page.locator(".kit-status-dot--unclean").first(),
).toBeVisible();
});
test("unclean session is reachable by direct URL", async ({
page,
}) => {
// The detail page no longer shows a banner — the StatusDot in
// the sidebar conveys the same signal — but the session must
// still be navigable by ID.
await page.goto(`/sessions/${UNCLEAN_SESSION_ID}`);
await expect(
page.locator(`.session-item[data-session-id="${UNCLEAN_SESSION_ID}"]`),
).toBeVisible();
});
});