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

address review (claude): pin empty-styleImageRefs fallback (present-but-empty ≠ absent)

[._.]/ Adam Eivy8f9c2c759224
diff --git a/client/src/pages/Universes.test.jsx b/client/src/pages/Universes.test.jsx
index a83c85d6b0..925992c87e 100644
--- a/client/src/pages/Universes.test.jsx
+++ b/client/src/pages/Universes.test.jsx
@@ -125,6 +125,20 @@ describe('Universes page — row thumbnail', () => {
expect(img.getAttribute('src')).not.toContain('contact-sheet.png');
});
+ it('treats an empty styleImageRefs array like a missing one and falls back to the media image', async () => {
+ // Key-present-but-empty must behave like key-absent (the `refs.length` guard),
+ // not crash on `refs[refs.length - 1]` (which would yield refs[-1] → undefined).
+ api.listUniverses.mockResolvedValue([
+ { id: 'u3', name: 'Void', styleImageRefs: [], updatedAt: '2026-06-01T00:00:00Z' },
+ ]);
+ api.listMediaCollections.mockResolvedValue([
+ { universeId: 'u3', items: [{ kind: 'image', ref: 'media.png', addedAt: '2026-06-10T00:00:00Z' }] },
+ ]);
+ const { container } = renderPage();
+ await waitFor(() => expect(screen.getAllByText('Void').length).toBeGreaterThan(0));
+ expect(container.querySelector('img').getAttribute('src')).toContain('media.png');
+ });
+
it('falls back to the latest media-collection image when no base style image exists', async () => {
api.listUniverses.mockResolvedValue([
{ id: 'u2', name: 'Reality', updatedAt: '2026-06-01T00:00:00Z' },