@@ -9,10 +9,7 @@ import { Column, DelimiterType, FileType, GridOption, MenuCommandItem, MenuComma
9
9
import { Formatters } from '../../formatters' ;
10
10
11
11
declare var Slick : any ;
12
-
13
- const gridId = 'grid1' ;
14
12
const gridUid = 'slickgrid_124343' ;
15
- const containerId = 'demo-container' ;
16
13
17
14
const excelExportServiceStub = {
18
15
exportToExcel : jest . fn ( ) ,
@@ -546,7 +543,6 @@ describe('contextMenuExtension', () => {
546
543
} ) ;
547
544
548
545
it ( 'should call "copyToClipboard", without export formatter, when the command triggered is "copy"' , ( ) => {
549
- const setActiveCellSpy = jest . spyOn ( SharedService . prototype . grid , 'setActiveCell' ) ;
550
546
const copyGridOptionsMock = { ...gridOptionsMock , enableExcelExport : false , enableExport : false , contextMenu : { hideCopyCellValueCommand : false } } as GridOption ;
551
547
const columnMock = { id : 'firstName' , name : 'First Name' , field : 'firstName' } as Column ;
552
548
const dataContextMock = { id : 123 , firstName : 'John' , lastName : 'Doe' , age : 50 } ;
@@ -567,12 +563,10 @@ describe('contextMenuExtension', () => {
567
563
value : 'John'
568
564
} ) ;
569
565
570
- expect ( setActiveCellSpy ) . toHaveBeenCalledWith ( 5 , 2 , false ) ;
571
566
expect ( execSpy ) . toHaveBeenCalledWith ( 'copy' , false , 'John' ) ;
572
567
} ) ;
573
568
574
569
it ( 'should call "copyToClipboard", WITH export formatter, when the command triggered is "copy"' , ( ) => {
575
- const setActiveCellSpy = jest . spyOn ( SharedService . prototype . grid , 'setActiveCell' ) ;
576
570
const copyGridOptionsMock = { ...gridOptionsMock , enableExcelExport : false , enableExport : false , exportOptions : { exportWithFormatter : true } } as GridOption ;
577
571
const columnMock = { id : 'firstName' , name : 'First Name' , field : 'firstName' , formatter : Formatters . uppercase } as Column ;
578
572
const dataContextMock = { id : 123 , firstName : 'John' , lastName : 'Doe' , age : 50 } ;
@@ -592,7 +586,6 @@ describe('contextMenuExtension', () => {
592
586
value : 'John'
593
587
} ) ;
594
588
595
- expect ( setActiveCellSpy ) . toHaveBeenCalledWith ( 5 , 2 , false ) ;
596
589
expect ( execSpy ) . toHaveBeenCalledWith ( 'copy' , false , 'JOHN' ) ;
597
590
} ) ;
598
591
0 commit comments