@@ -97,18 +97,36 @@ describe('Console View Switching Integration', () => {
9797
9898 renderObjectView ( ) ;
9999
100- // Should NOT show "Unknown component type"
100+ // 1. Check registry has the component (verifies import)
101+ expect ( ComponentRegistry . has ( 'object-timeline' ) ) . toBe ( true ) ;
102+
103+ // 2. Check no error boundary (verifies unknown type)
101104 expect ( screen . queryByText ( / U n k n o w n c o m p o n e n t t y p e / i) ) . not . toBeInTheDocument ( ) ;
102105
103- expect ( ComponentRegistry . has ( 'object-timeline' ) ) . toBe ( true ) ;
106+ // 3. Check CONTENT is rendered (verifies options/props passed correctly + not blank)
107+ // Since we are using the real Timeline component, we need to know what it renders when empty.
108+ // It usually renders a list or empty state.
109+ // If options were missing, it might crash or render completely blank.
110+ // Let's assume it renders at least the wrapper or "No items"
111+ const timeline = document . querySelector ( '.object-timeline' ) || document . querySelector ( 'ol' ) ;
112+ expect ( timeline ) . toBeInTheDocument ( ) ;
104113 } ) ;
105114
106115 it ( 'switches to Map view correctly' , ( ) => {
107116 mockSearchParams . set ( 'view' , 'sites' ) ;
108117 renderObjectView ( ) ;
109118
110- expect ( screen . queryByText ( / U n k n o w n c o m p o n e n t t y p e / i) ) . not . toBeInTheDocument ( ) ;
111119 expect ( ComponentRegistry . has ( 'object-map' ) ) . toBe ( true ) ;
120+ expect ( screen . queryByText ( / U n k n o w n c o m p o n e n t t y p e / i) ) . not . toBeInTheDocument ( ) ;
121+
122+ // 3. Verify content
123+ // Map usually renders a container.
124+ // If we missed options mapping, it might be 0 height or error.
125+ const mapContainer = document . querySelector ( '.object-map' ) || document . querySelector ( '[class*="leaflet"]' ) ;
126+ // Since we don't have leaflet installed/mocked fully, it might be just a div.
127+ // But checking that *something* is in the View area is key.
128+ const viewArea = document . querySelector ( '.flex-1.overflow-hidden.relative' ) ;
129+ expect ( viewArea ) . not . toBeEmptyDOMElement ( ) ;
112130 } ) ;
113131
114132 it ( 'switches to Gantt view correctly' , ( ) => {
0 commit comments