Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix: synchronize client tests with imports navigation and hydration

[._.]/ Adam Eivy1a14f2e2c6f6
diff --git a/client/src/components/music/TracksManager.test.jsx b/client/src/components/music/TracksManager.test.jsx
index 428c82a424..bcad46741b 100644
--- a/client/src/components/music/TracksManager.test.jsx
+++ b/client/src/components/music/TracksManager.test.jsx
@@ -249,6 +249,8 @@ describe('<TracksManager> generative workflow hand-off', () => {
}]);
musicGenProps.current = null;
renderAt('track-1');
+ // Wait for form hydration before interacting with the selected track.
+ await screen.findByDisplayValue('Current source');
fireEvent.click(await screen.findByRole('button', { name: 'Remix render-explicit' }));
await waitFor(() => expect(musicGenProps.current?.remix).toEqual(expect.objectContaining({ instrumentalOnly: true })));
diff --git a/client/src/pages/MediaCollections.test.jsx b/client/src/pages/MediaCollections.test.jsx
index 531faa5a88..af6c167226 100644
--- a/client/src/pages/MediaCollections.test.jsx
+++ b/client/src/pages/MediaCollections.test.jsx
@@ -1,7 +1,7 @@
import { describe, it, expect, vi, beforeEach } from 'vitest';
import { render, screen, waitFor, within } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
-import { MemoryRouter, useLocation, useNavigate } from 'react-router';
+import { MemoryRouter, Routes, Route, useLocation, useNavigate } from 'react-router';
import { typeSettled } from '../test/settledInput';
// ── Mock API calls ───────────────────────────────────────────────────────────
@@ -75,7 +75,10 @@ function RouteProbe() {
function renderPage(entry = '/media/collections') {
return render(
<MemoryRouter initialEntries={[entry]}>
- <MediaCollections />
+ <Routes>
+ <Route path="/media/collections" element={<MediaCollections />} />
+ <Route path="/media/collections/:id" element={<div>Collection detail</div>} />
+ </Routes>
<RouteProbe />
</MemoryRouter>,
);
diff --git a/client/src/pages/loadingSkeletons.test.jsx b/client/src/pages/loadingSkeletons.test.jsx
index ee8c76bdf9..88d44b6ce1 100644
--- a/client/src/pages/loadingSkeletons.test.jsx
+++ b/client/src/pages/loadingSkeletons.test.jsx
@@ -141,6 +141,13 @@ const RENDERED = [
['WorkspaceContexts', () => import('./WorkspaceContexts'), '/workspace-contexts', '/workspace-contexts', 'Loading workspace projects'],
];
+// Module loading is setup, not part of the first-paint interaction. Resolve it
+// before tests so a timed-out import cannot mount into the next case.
+const LOADED_PAGES = await Promise.all(RENDERED.map(async ([name, load, ...rest]) => {
+ const mod = await load();
+ return [name, mod.default || mod, ...rest];
+}));
+
describe('converted pages announce a labelled busy region on first paint', () => {
beforeEach(() => {
// jsdom ships no `matchMedia`, and a page that reads one on mount throws
@@ -155,9 +162,7 @@ describe('converted pages announce a labelled busy region on first paint', () =>
// A DATA router, not `<MemoryRouter>`: pages that guard unsaved edits call
// `useBlocker`, which throws outside one.
- it.each(RENDERED)('%s', async (_name, load, routePath, entry, label) => {
- const mod = await load();
- const Page = mod.default || mod;
+ it.each(LOADED_PAGES)('%s', async (_name, Page, routePath, entry, label) => {
const router = createMemoryRouter(
[{ path: routePath, element: <Page /> }],
{ initialEntries: [entry] },