Files
nanobot/webui/src/tests/activity-step.test.tsx
T
chengyongru 7cb396788c refactor(ui): replace middle-dot separators with clearer hierarchy (#6087)
* refactor(ui): replace middle-dot separators with clearer hierarchy

* refactor(ui): use layout instead of punctuation separators
2026-10-07 15:19:55 +08:00

23 lines
855 B
TypeScript

import { cleanup, render, screen, within } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { afterEach, expect, it } from "vitest";
import { ActivityStep } from "@/components/thread/activity/ActivityStep";
afterEach(cleanup);
it("keeps truncated activity details available on keyboard focus", async () => {
render(<ActivityStep label="Used Blender" detail="--json project new" />);
const detail = screen.getByText("--json project new");
Object.defineProperties(detail, {
scrollWidth: { value: 240 },
clientWidth: { value: 80 },
});
await userEvent.tab();
expect(screen.getByLabelText("Used Blender, --json project new")).toHaveFocus();
const tooltip = await screen.findByRole("tooltip");
expect(within(tooltip).getByText(/Used Blender/)).toHaveTextContent("--json project new");
});