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 that Cast & Sets images open the music video lightbox

Claudec819e78a8935
diff --git a/client/src/pages/MusicVideo.test.jsx b/client/src/pages/MusicVideo.test.jsx
index 38eada46f0..fccb04bafe 100644
--- a/client/src/pages/MusicVideo.test.jsx
+++ b/client/src/pages/MusicVideo.test.jsx
@@ -2340,6 +2340,26 @@ describe('MusicVideo media lightbox (#3718)', () => {
});
});
+ it('opens Cast & Sets references and their inputs in the lightbox, not the raw file', async () => {
+ const castAndSets = {
+ revision: 1, status: 'review',
+ plan: { lead: { key: 'lead', label: 'Lead', prompt: 'Lead portrait', deps: [], refKeys: [], moodRefs: true } },
+ images: { lead: { status: 'done', imageId: 'lead.png', submittedPrompt: 'Lead portrait', submittedRevision: 1, submittedReferences: [{ kind: 'image-ref', filename: 'mood.png' }] } },
+ moodImages: [{ kind: 'image-ref', filename: 'mood.png' }],
+ };
+ await openProject({ ...PROJECT_NO_CLIP, castAndSets }, 'cast-sets');
+ const card = within(await screen.findByRole('article', { name: 'Lead' }));
+ expect(card.queryByRole('link')).toBeNull();
+ fireEvent.click(card.getByRole('button', { name: 'Preview Lead' }));
+ let dialog = await screen.findByRole('dialog', { name: /Media viewer/i });
+ expect(dialog.innerHTML).toMatch(/\/data\/images\/lead\.png/);
+ fireEvent.keyDown(window, { key: 'Escape' });
+ await waitFor(() => expect(screen.queryByRole('dialog', { name: /Media viewer/i })).toBeNull());
+ fireEvent.click(card.getByRole('button', { name: 'Lead input: mood.png' }));
+ dialog = await screen.findByRole('dialog', { name: /Media viewer/i });
+ expect(dialog.innerHTML).toMatch(/\/data\/image-refs\/mood\.png/);
+ });
+
it('opens the lightbox from a ?preview= deep link on mount', async () => {
listMusicVideoProjects.mockResolvedValue([PROJECT_WITH_CLIP]);
renderMVAt('/music-video/mv-1?preview=image%3Aimg1');