@@ -9,6 +9,17 @@ import { condoAEntry1, condoAEntry2 } from '../../mocks/mockEntries';
99import { Notification } from '@contentful/f36-components' ;
1010import type { ContentTypeProps } from 'contentful-management' ;
1111
12+ // Mock the virtualizer to render all items in tests
13+ vi . mock ( '@tanstack/react-virtual' , ( ) => ( {
14+ useVirtualizer : ( ) => ( {
15+ getVirtualItems : ( ) => [
16+ { index : 0 , start : 0 , size : 50 , end : 50 } ,
17+ { index : 1 , start : 50 , size : 50 , end : 100 } ,
18+ ] ,
19+ getTotalSize : ( ) => 100 ,
20+ } ) ,
21+ } ) ) ;
22+
1223vi . mock ( '@contentful/react-apps-toolkit' , ( ) => ( {
1324 useSDK : ( ) => mockSdk ,
1425} ) ) ;
@@ -48,12 +59,12 @@ describe('Page', () => {
4859 } ) ;
4960 } ) ;
5061
51- it ( 'does not show Edit/Bulk edit button when no field is selected' , async ( ) => {
62+ it ( 'show Edit/Bulk edit button when no field is selected' , async ( ) => {
5263 render ( < Page /> ) ;
5364 await waitFor ( ( ) => {
5465 expect ( screen . getByTestId ( 'bulk-edit-table' ) ) . toBeInTheDocument ( ) ;
5566 } ) ;
56- expect ( screen . queryByText ( 'Edit' ) ) . not . toBeInTheDocument ( ) ;
67+ expect ( screen . queryByText ( 'Edit' ) ) . toBeInTheDocument ( ) ;
5768 expect ( screen . queryByText ( 'Bulk edit' ) ) . not . toBeInTheDocument ( ) ;
5869 } ) ;
5970} ) ;
0 commit comments