File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change
1
+ const ExcelJS = verquire ( 'exceljs' ) ;
2
+
3
+ const TEST_XLSX_FILE_NAME = './spec/out/wb.test.xlsx' ;
4
+
5
+ describe ( 'github issues' , ( ) => {
6
+ it ( 'pull request 1334 - Fix the error that comment does not delete at spliceColumn' , async ( ) => {
7
+ ( async ( ) => {
8
+ const wb = new ExcelJS . Workbook ( ) ;
9
+ const ws = wb . addWorksheet ( 'testSheet' ) ;
10
+
11
+ ws . addRow ( [
12
+ 'test1' ,
13
+ 'test2' ,
14
+ 'test3' ,
15
+ 'test4' ,
16
+ 'test5' ,
17
+ 'test6' ,
18
+ 'test7' ,
19
+ 'test8' ,
20
+ ] ) ;
21
+
22
+ const row = ws . getRow ( 1 ) ;
23
+ row . getCell ( 1 ) . note = 'test1' ;
24
+ row . getCell ( 2 ) . note = 'test2' ;
25
+ row . getCell ( 3 ) . note = 'test3' ;
26
+ row . getCell ( 4 ) . note = 'test4' ;
27
+
28
+ ws . spliceColumns ( 2 , 1 ) ;
29
+
30
+ expect ( row . getCell ( 1 ) . note ) . to . equal ( 'test1' ) ;
31
+ expect ( row . getCell ( 2 ) . note ) . to . equal ( 'test3' ) ;
32
+ expect ( row . getCell ( 3 ) . note ) . to . equal ( 'test4' ) ;
33
+ expect ( row . getCell ( 4 ) . note ) . to . equal ( undefined ) ;
34
+
35
+ await wb . xlsx . writeFile ( TEST_XLSX_FILE_NAME ) ;
36
+ } ) ( ) ;
37
+ } ) ;
38
+ } ) ;
You can’t perform that action at this time.
0 commit comments