21508: Fix unit test for io panel by mocking autosizer for virtuallist
authorStephen Smith <stephen@curii.com>
Wed, 3 Apr 2024 14:10:29 +0000 (10:10 -0400)
committerStephen Smith <stephen@curii.com>
Wed, 3 Apr 2024 14:10:29 +0000 (10:10 -0400)
Arvados-DCO-1.1-Signed-off-by: Stephen Smith <stephen@curii.com>

services/workbench2/src/views/process-panel/process-io-card.test.tsx

index 292f6cccf7d16e5faa42d44b52e36ca4bd494fa1..ff1ec24de12122a10e4c94925564a721dc491bee 100644 (file)
@@ -15,8 +15,11 @@ import { DefaultCodeSnippet } from "components/default-code-snippet/default-code
 import { ProcessOutputCollectionFiles } from './process-output-collection-files';
 import { MemoryRouter } from 'react-router-dom';
 
-
+// Mock collection files component since it just needs to exist
 jest.mock('views/process-panel/process-output-collection-files');
+// Mock autosizer for the io panel virtual list
+jest.mock('react-virtualized-auto-sizer', () => ({ children }: any) => children({ height: 600, width: 600 }));
+
 configure({ adapter: new Adapter() });
 
 describe('renderers', () => {
@@ -113,7 +116,7 @@ describe('renderers', () => {
 
         it('shows main process with params', () => {
             // when
-            const parameters = [{id: 'someId', label: 'someLabel', value: [{display: 'someValue'}]}];
+            const parameters = [{id: 'someId', label: 'someLabel', value: {display: 'someValue'}}];
             let panel = mount(
                 <Provider store={store}>
                     <MuiThemeProvider theme={CustomTheme}>