Merge story 74: agent lozenges float across UI during assignment
Resolves conflict in AgentPanel.test.tsx between story 73 (fade-out) and story 74 (lozenge fly animation) - kept both the assertion and the comment. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,14 @@
|
||||
import { act, render, screen, waitFor } from "@testing-library/react";
|
||||
import userEvent from "@testing-library/user-event";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import {
|
||||
afterEach,
|
||||
beforeAll,
|
||||
beforeEach,
|
||||
describe,
|
||||
expect,
|
||||
it,
|
||||
vi,
|
||||
} from "vitest";
|
||||
import type { AgentConfigInfo, AgentInfo } from "../api/agents";
|
||||
import { agentsApi } from "../api/agents";
|
||||
|
||||
@@ -337,15 +345,21 @@ describe("AgentPanel fade-out", () => {
|
||||
|
||||
const { container } = render(<AgentPanel />);
|
||||
|
||||
// Wait for the agent entry to appear
|
||||
await waitFor(() => {
|
||||
expect(
|
||||
container.querySelector(
|
||||
'[data-testid="agent-entry-73_remove_test:coder-1"]',
|
||||
),
|
||||
).toBeInTheDocument();
|
||||
// With fake timers active, waitFor's polling setInterval never fires.
|
||||
// Use act to flush pending promises and React state updates instead.
|
||||
await act(async () => {
|
||||
await Promise.resolve();
|
||||
await Promise.resolve();
|
||||
await Promise.resolve();
|
||||
await Promise.resolve();
|
||||
});
|
||||
|
||||
expect(
|
||||
container.querySelector(
|
||||
'[data-testid="agent-entry-73_remove_test:coder-1"]',
|
||||
),
|
||||
).toBeInTheDocument();
|
||||
|
||||
// Advance timers by 60 seconds and flush React state updates
|
||||
await act(async () => {
|
||||
vi.advanceTimersByTime(60_000);
|
||||
|
||||
Reference in New Issue
Block a user