story-kit: merge 77_bug_create_bug_file_writes_no_yaml_front_matter

This commit is contained in:
Dave
2026-02-23 14:56:08 +00:00
parent 532031102d
commit 6e9b5da458
2 changed files with 23 additions and 11 deletions

View File

@@ -1,4 +1,4 @@
import { render, screen, waitFor } from "@testing-library/react";
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 type { AgentConfigInfo, AgentInfo } from "../api/agents";
@@ -315,7 +315,7 @@ describe("AgentPanel fade-out", () => {
describe("removes the agent entry after 60s", () => {
beforeEach(() => {
vi.useFakeTimers();
vi.useFakeTimers({ shouldAdvanceTime: true });
});
afterEach(() => {
@@ -346,17 +346,17 @@ describe("AgentPanel fade-out", () => {
).toBeInTheDocument();
});
// Advance timers by 60 seconds
vi.advanceTimersByTime(60_000);
// Advance timers by 60 seconds and flush React state updates
await act(async () => {
vi.advanceTimersByTime(60_000);
});
// Entry should be removed
await waitFor(() => {
expect(
container.querySelector(
'[data-testid="agent-entry-73_remove_test:coder-1"]',
),
).not.toBeInTheDocument();
});
expect(
container.querySelector(
'[data-testid="agent-entry-73_remove_test:coder-1"]',
),
).not.toBeInTheDocument();
});
});
});