@@ -49,8 +49,8 @@ describe('<PickLibraryContentModal />', () => {
4949 } ) ;
5050
5151 it ( 'can pick components from the modal' , async ( ) => {
52- const mockAddComponentsToCollection = jest . fn ( ) ;
53- jest . spyOn ( api , 'addComponentsToCollection ' ) . mockImplementation ( mockAddComponentsToCollection ) ;
52+ const mockAddItemsToCollection = jest . fn ( ) ;
53+ jest . spyOn ( api , 'addItemsToCollection ' ) . mockImplementation ( mockAddItemsToCollection ) ;
5454
5555 render ( ) ;
5656
@@ -67,7 +67,7 @@ describe('<PickLibraryContentModal />', () => {
6767 fireEvent . click ( screen . queryAllByRole ( 'button' , { name : 'Add to Collection' } ) [ 0 ] ) ;
6868
6969 await waitFor ( ( ) => {
70- expect ( mockAddComponentsToCollection ) . toHaveBeenCalledWith (
70+ expect ( mockAddItemsToCollection ) . toHaveBeenCalledWith (
7171 libraryId ,
7272 'collectionId' ,
7373 [ 'lb:Axim:TEST:html:571fe018-f3ce-45c9-8f53-5dafcb422fdd' ] ,
@@ -78,8 +78,8 @@ describe('<PickLibraryContentModal />', () => {
7878 } ) ;
7979
8080 it ( 'show error when api call fails' , async ( ) => {
81- const mockAddComponentsToCollection = jest . fn ( ) . mockRejectedValue ( new Error ( 'Failed to add components' ) ) ;
82- jest . spyOn ( api , 'addComponentsToCollection ' ) . mockImplementation ( mockAddComponentsToCollection ) ;
81+ const mockAddItemsToCollection = jest . fn ( ) . mockRejectedValue ( new Error ( 'Failed to add components' ) ) ;
82+ jest . spyOn ( api , 'addItemsToCollection ' ) . mockImplementation ( mockAddItemsToCollection ) ;
8383 render ( ) ;
8484
8585 // Wait for the content library to load
@@ -95,7 +95,7 @@ describe('<PickLibraryContentModal />', () => {
9595 fireEvent . click ( screen . queryAllByRole ( 'button' , { name : 'Add to Collection' } ) [ 0 ] ) ;
9696
9797 await waitFor ( ( ) => {
98- expect ( mockAddComponentsToCollection ) . toHaveBeenCalledWith (
98+ expect ( mockAddItemsToCollection ) . toHaveBeenCalledWith (
9999 libraryId ,
100100 'collectionId' ,
101101 [ 'lb:Axim:TEST:html:571fe018-f3ce-45c9-8f53-5dafcb422fdd' ] ,
0 commit comments