File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -31,9 +31,12 @@ const ensureCellSelection = () => {
3131};
3232
3333const handleSelect = (color ) => {
34- const value = color === ' none' ? null : color;
3534 ensureCellSelection ();
36- props .editor .commands .setCellBackground (value);
35+ if (color === ' none' ) {
36+ props .editor .commands .setCellAttr (' background' , null );
37+ } else {
38+ props .editor .commands .setCellBackground (color);
39+ }
3740 props .closePopover ();
3841};
3942 </script >
Original file line number Diff line number Diff line change @@ -42,6 +42,7 @@ describe('CellBackgroundPicker', () => {
4242 commands : {
4343 setCellSelection : vi . fn ( ) ,
4444 setCellBackground : vi . fn ( ) ,
45+ setCellAttr : vi . fn ( ) ,
4546 } ,
4647 } ;
4748 } ) ;
@@ -91,12 +92,14 @@ describe('CellBackgroundPicker', () => {
9192 expect ( closePopover ) . toHaveBeenCalled ( ) ;
9293 } ) ;
9394
94- it ( 'should map "none" to null for removing background' , ( ) => {
95+ it ( 'should map "none" to setCellAttr(background, null) for removing background' , ( ) => {
9596 isCellSelection . mockReturnValue ( true ) ;
9697
9798 const wrapper = mountPicker ( ) ;
9899 wrapper . findComponent ( { name : 'IconGrid' } ) . vm . $emit ( 'select' , 'none' ) ;
99100
100- expect ( mockEditor . commands . setCellBackground ) . toHaveBeenCalledWith ( null ) ;
101+ expect ( mockEditor . commands . setCellBackground ) . not . toHaveBeenCalled ( ) ;
102+ expect ( mockEditor . commands . setCellAttr ) . toHaveBeenCalledWith ( 'background' , null ) ;
103+ expect ( closePopover ) . toHaveBeenCalled ( ) ;
101104 } ) ;
102105} ) ;
You can’t perform that action at this time.
0 commit comments