File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed
packages/compass-crud/src/components Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -104,12 +104,13 @@ describe('useDocumentItemContextMenu', function () {
104104
105105 // Should show "Stop editing" when editing
106106 expect ( screen . getByText ( 'Cancel editing' ) ) . to . exist ;
107+ // Should not show "Edit document" or "Delete document" while editing
107108 expect ( screen . queryByText ( 'Edit document' ) ) . to . not . exist ;
109+ expect ( screen . queryByText ( 'Delete document' ) ) . to . not . exist ;
108110 // But show other operations
109111 expect ( screen . getByText ( 'Expand all fields' ) ) . to . exist ;
110112 expect ( screen . getByText ( 'Copy document' ) ) . to . exist ;
111113 expect ( screen . getByText ( 'Clone document...' ) ) . to . exist ;
112- expect ( screen . getByText ( 'Delete document' ) ) . to . exist ;
113114 } ) ;
114115 } ) ;
115116
Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ export function useDocumentItemContextMenu({
6767 : undefined ,
6868 ] ,
6969 } ,
70- isEditable
70+ isEditable && ! isEditing
7171 ? {
7272 telemetryLabel : 'Document Item Delete' ,
7373 items : [
You can’t perform that action at this time.
0 commit comments