55 */
66
77import React from 'react' ;
8- import { i18n } from '@kbn/i18n' ;
98import { mount , shallow } from 'enzyme' ;
109import { act } from 'react-dom/test-utils' ;
1110import { EuiIcon } from '@elastic/eui' ;
12- import { NewBucketButton , DragDropBuckets , DraggableBucketContainer } from '../shared_components' ;
11+ import { DragDropBuckets , DraggableBucketContainer } from '../shared_components' ;
1312
1413jest . mock ( '@elastic/eui' , ( ) => {
1514 const original = jest . requireActual ( '@elastic/eui' ) ;
1615 return {
1716 ...original ,
1817 EuiDragDropContext : 'eui-drag-drop-context' ,
1918 EuiDroppable : 'eui-droppable' ,
20- EuiDraggable : ( props ) => props . children ( { dragHandleProps : { } } ) ,
19+ EuiDraggable : ( props : any ) => props . children ( ) , // eslint-disable-line @typescript-eslint/no-explicit-any
2120 } ;
2221} ) ;
2322
2423describe ( 'buckets shared components' , ( ) => {
2524 describe ( 'DragDropBuckets' , ( ) => {
2625 it ( 'should call onDragEnd when dragging ended with reordered items' , ( ) => {
27- const items = [ ' first' , ' second' , ' third' ] ;
26+ const items = [ < div key = "1" > first</ div > , < div key = "2" > second</ div > , < div key = "3" > third</ div > ] ;
2827 const defaultProps = {
2928 items,
3029 onDragStart : jest . fn ( ) ,
@@ -38,7 +37,11 @@ describe('buckets shared components', () => {
3837 instance . props ( ) . onDragEnd ( { source : { index : 0 } , destination : { index : 1 } } ) ;
3938 } ) ;
4039
41- expect ( defaultProps . onDragEnd ) . toHaveBeenCalledWith ( [ 'second' , 'first' , 'third' ] ) ;
40+ expect ( defaultProps . onDragEnd ) . toHaveBeenCalledWith ( [
41+ < div key = "2" > second</ div > ,
42+ < div key = "1" > first</ div > ,
43+ < div key = "3" > third</ div > ,
44+ ] ) ;
4245 } ) ;
4346 } ) ;
4447 describe ( 'DraggableBucketContainer' , ( ) => {
@@ -48,7 +51,7 @@ describe('buckets shared components', () => {
4851 onRemoveClick : jest . fn ( ) ,
4952 removeTitle : 'remove' ,
5053 children : < div data-test-subj = "popover" > popover</ div > ,
51- id : 0 ,
54+ id : '0' ,
5255 idx : 0 ,
5356 } ;
5457 it ( 'should render valid component' , ( ) => {
0 commit comments