@@ -133,4 +133,45 @@ describe('WorkspaceData', () => {
133133 { timeout : 10000 }
134134 ) ;
135135 } , 15000 ) ;
136+
137+ it ( 'has scrollable tableViewPanel to allow vertical scrolling when content is too tall' , async ( ) => {
138+ // Setup mocks for the test
139+ const mockEntityMetadata = jest . fn ( ) ;
140+ mockEntityMetadata . mockResolvedValue ( entityMetadata ) ;
141+
142+ asMockedFn ( Workspaces ) . mockReturnValue ( {
143+ workspace : ( _namespace : string , _name : string ) => ( {
144+ entityMetadata : mockEntityMetadata ,
145+ } ) ,
146+ } as any ) ;
147+
148+ ( getIgvUrlParams as jest . Mock ) . mockReturnValue ( {
149+ igvSession : null ,
150+ igvGenome : null ,
151+ } ) ;
152+
153+ const workspaceDataProps = {
154+ namespace : 'test-namespace' ,
155+ name : 'test-name' ,
156+ workspace : defaultGoogleWorkspace ,
157+ refreshWorkspace : ( ) => { } ,
158+ storageDetails : { ...defaultGoogleBucketOptions } ,
159+ } ;
160+
161+ await act ( async ( ) => {
162+ render ( h ( WorkspaceData , workspaceDataProps ) ) ;
163+ } ) ;
164+
165+ await waitFor ( ( ) => {
166+ // Find the element with the tableViewPanel styles
167+ // The tableViewPanel should have overflow: 'auto' to enable scrolling
168+ const tableViewPanels = document . querySelectorAll ( '[style*="overflow"]' ) ;
169+ const hasScrollablePanel = Array . from ( tableViewPanels ) . some ( ( el ) => {
170+ const style = ( el as HTMLElement ) . style ;
171+ return style . overflow === 'auto' || style . overflowY === 'auto' ;
172+ } ) ;
173+
174+ expect ( hasScrollablePanel ) . toBe ( true ) ;
175+ } ) ;
176+ } ) ;
136177} ) ;
0 commit comments