- #151: chevauchement des boutons dans la barre supérieure pendant une conversation agent - #158: popup de reprise de conversation intempestive (ajout cellule / changement layout / projet) - #159: pastille d'activité de projet
This commit is contained in:
@ -7,7 +7,7 @@
|
||||
* read as faint text rather than a control.
|
||||
*/
|
||||
import { describe, it, expect, vi } from "vitest";
|
||||
import { render, screen, fireEvent } from "@testing-library/react";
|
||||
import { render, screen, fireEvent, within } from "@testing-library/react";
|
||||
|
||||
import type { TabItem } from "@/shared";
|
||||
import { ProjectTabs } from "./ProjectTabs";
|
||||
@ -27,6 +27,7 @@ function renderTabs(props: Partial<React.ComponentProps<typeof ProjectTabs>> = {
|
||||
onClose={props.onClose ?? vi.fn()}
|
||||
projectsPanelOpen={props.projectsPanelOpen ?? false}
|
||||
onOpenProjectsPanel={onOpenProjectsPanel}
|
||||
activityByProjectId={props.activityByProjectId}
|
||||
/>,
|
||||
);
|
||||
return { onOpenProjectsPanel };
|
||||
@ -74,3 +75,24 @@ describe("ProjectTabs add-project button (#46)", () => {
|
||||
expect(onOpenProjectsPanel).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
});
|
||||
|
||||
describe("ProjectTabs project activity dots (#159)", () => {
|
||||
it("renders the neutral activity dot to the left of a project name by default", () => {
|
||||
renderTabs({ items: TABS });
|
||||
|
||||
const tab = screen.getByRole("tab", { name: /alpha/ });
|
||||
expect(
|
||||
within(tab).getByTitle("alpha : aucune conversation active"),
|
||||
).toBeTruthy();
|
||||
});
|
||||
|
||||
it("renders idle and busy project activity states", () => {
|
||||
renderTabs({
|
||||
items: TABS,
|
||||
activityByProjectId: { a: "idle", b: "busy" },
|
||||
});
|
||||
|
||||
expect(screen.getByTitle("alpha : conversation ouverte")).toBeTruthy();
|
||||
expect(screen.getByTitle("beta : activité en cours")).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user