Files
fusion/packages/dashboard/app/components/__tests__/MigrationInProgressBanner.test.tsx
gsxdsm 0b6c4cd4ca feat(dashboard,desktop): show live database-migration progress during boot
The one-time SQLite→PostgreSQL migration runs inside createTaskStoreForBackend
before any HTTP server listens, so browsers saw "connection refused" and open
tabs failed silently for minutes. Now:

- CLI: a temporary holding server binds the dashboard port for the boot window,
  serving an auto-reloading "Database migration in progress" page and an
  /api/health payload with status "migrating" + structured progress; the port
  is handed off (awaited) to the real app.listen().
- Dashboard SPA: already-open tabs render the new MigrationInProgressBanner
  from the 15s health poll when status is "migrating".
- Desktop: LocalRuntimeManager publishes migration progress on
  DesktopRuntimeStatus via the new core onMigrationProgress option;
  DesktopLaunchGate shows the live label and extends its 30s startup timeout
  while progress advances (2min stall cap), in both boot and first-run flows.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-17 20:09:56 -07:00

26 lines
1.1 KiB
TypeScript

/*
FNXC:MigrationHoldingPage 2026-07-17-12:50:
Pins the open-tab migration banner contract: hidden unless health reports
status "migrating", and shows the structured progress label when present.
*/
import { describe, expect, it } from "vitest";
import { render, screen } from "@testing-library/react";
import { MigrationInProgressBanner } from "../MigrationInProgressBanner";
describe("MigrationInProgressBanner", () => {
it("renders nothing when inactive", () => {
const { container } = render(<MigrationInProgressBanner isActive={false} progressLabel="ignored" />);
expect(container).toBeEmptyDOMElement();
});
it("renders status copy when active", () => {
render(<MigrationInProgressBanner isActive />);
expect(screen.getByRole("status")).toHaveTextContent("Database migration in progress");
});
it("shows the structured progress label when provided", () => {
render(<MigrationInProgressBanner isActive progressLabel="[3/12] project.tasks — 500/2000 rows" />);
expect(screen.getByRole("status")).toHaveTextContent("[3/12] project.tasks — 500/2000 rows");
});
});