AkurAI Build
Menu

popagent

public

Latest change 3b42df6c31e8a0d994f2e89e185a91aa8073a7d1 - Clarify work status accessibility labels by AkurAI Build

import { describe, expect, test } from "bun:test";
import { renderToStaticMarkup } from "react-dom/server";
import { WorkspaceChatDeleteDialog, WorkspaceOverview } from "./WorkspaceOverview";

describe("WorkspaceChatDeleteDialog", () => {
  test("confirms permanent deletion of active and archived workspace chats", () => {
    const html = renderToStaticMarkup(<WorkspaceChatDeleteDialog
      workspace={{ id: "docs", name: "Docs", repositoryPath: "docs", createdAt: "", updatedAt: "" }}
      deleting={false}
      error=""
      onCancel={() => {}}
      onDelete={() => {}}
    />);

    expect(html).toContain("Delete all chats in “Docs”?");
    expect(html).toContain("active and archived chats");
    expect(html).toContain("Independent long-term memories are retained");
  });
});

test("organizes the root around operational status, live work, and repositories", () => {
  const html = renderToStaticMarkup(<WorkspaceOverview
    workspaces={[{ id: "mail", name: "AkurAI-Mail", repositoryPath: "AkurAI-Mail", createdAt: "", updatedAt: "" }]}
    sessions={[]}
    tasks={[{
      id: "mail-task",
      sessionId: null,
      scheduleId: null,
      source: "user",
      workspaceId: "mail",
      prompt: "Configure mail clients",
      model: "cx/gpt-5.6-sol",
      status: "running",
      output: null,
      error: null,
      stepsCompleted: 4,
      progress: "Reviewer checking TLS",
      recoveryCount: 0,
      attemptCount: 1,
      maxAttempts: 3,
      nextAttemptAt: null,
      lastErrorClass: null,
      deadLetteredAt: null,
      createdAt: "2026-08-14T18:16:51.000Z",
      startedAt: "2026-08-14T18:16:52.000Z",
      completedAt: null,
    }]}
    taskStepLimit={24}
    onCreateTask={async () => true}
    onCancelTask={() => {}}
    onOpen={() => {}}
    onManage={() => {}}
    onOpenNavigation={() => {}}
  />);

  expect(html).toContain("Agent command center");
  expect(html).toContain("Live work");
  expect(html).toContain("Repositories");
  expect(html).toContain('aria-haspopup="dialog"');
  expect(html).toContain('aria-label="1 task running"');
  expect(html).toContain('aria-label="0 tasks needing attention"');
  expect(html).not.toContain('aria-label="Task prompt"');
  expect(html).toContain("AkurAI-Mail");
  expect(html).toContain("Reviewer checking TLS");
  expect(html).toContain("4 of 24 steps");
});