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

test: settle animatic preview before title-card handshake (#11226)

Adam Eivy212805fe721c
diff --git a/client/src/components/musicVideo/StoryboardAnimatic.test.jsx b/client/src/components/musicVideo/StoryboardAnimatic.test.jsx
index 9c9d2ad4c6..68d42554bb 100644
--- a/client/src/components/musicVideo/StoryboardAnimatic.test.jsx
+++ b/client/src/components/musicVideo/StoryboardAnimatic.test.jsx
@@ -56,7 +56,10 @@ describe('StoryboardAnimatic lyrics', () => {
it('hands the opening title card to the lyric layer and again when it is edited', async () => {
const card = { enabled: true, title: 'Example Song', startSec: 2, endSec: 8 };
const { rerender } = render(<StoryboardAnimatic project={{ ...lyricProject, titleCard: card }} audioUrl="/song.mp3" />);
- const overlay = await screen.findByTestId('animatic-lyrics');
+ // Flush the preview promise AND its message-listener effect before the one-shot
+ // handshake. Finding the iframe only observes the DOM commit, not effect readiness.
+ await act(async () => {});
+ const overlay = screen.getByTestId('animatic-lyrics');
const post = vi.spyOn(overlay.contentWindow, 'postMessage');
await act(async () => { window.dispatchEvent(new MessageEvent('message', { source: overlay.contentWindow, data: { type: 'portos-mv:loaded' } })); });
expect(post).toHaveBeenCalledWith({ type: 'portos-mv:title-card', card: expect.objectContaining({ title: 'Example Song', position: 'lower-left' }) }, '*');