@@ -9,6 +9,7 @@ vi.mock('@icons/Repeat.vue', () => createIconMock('RepeatIcon'))
99vi . mock ( '@icons/Pencil.vue' , ( ) => createIconMock ( 'PencilIcon' ) )
1010vi . mock ( '@icons/Eye.vue' , ( ) => createIconMock ( 'EyeIcon' ) )
1111vi . mock ( '@icons/Delete.vue' , ( ) => createIconMock ( 'DeleteIcon' ) )
12+ vi . mock ( '@icons/ArrowRight.vue' , ( ) => createIconMock ( 'ArrowRightIcon' ) )
1213
1314vi . mock ( '@nextcloud/vue/components/NcButton' , ( ) => ( {
1415 default : {
@@ -195,6 +196,15 @@ describe('ChecklistItemRow', () => {
195196 expect ( wrapper . emitted ( 'edit' ) ! [ 0 ] ) . toEqual ( [ item ] )
196197 } )
197198
199+ it ( 'emits move with item on move action click' , async ( ) => {
200+ const item = makeItem ( )
201+ const wrapper = mount ( ChecklistItemRow , { props : { ...defaultProps , item } } )
202+ const moveBtn = wrapper . findAll ( '.nc-action-button' ) . find ( ( b ) => b . text ( ) === 'Move to list' ) !
203+ await moveBtn . trigger ( 'click' )
204+ expect ( wrapper . emitted ( 'move' ) ) . toBeTruthy ( )
205+ expect ( wrapper . emitted ( 'move' ) ! [ 0 ] ) . toEqual ( [ item ] )
206+ } )
207+
198208 it ( 'emits remove with item id on remove action click' , async ( ) => {
199209 const item = makeItem ( { id : 9 } )
200210 const wrapper = mount ( ChecklistItemRow , { props : { ...defaultProps , item } } )
0 commit comments