Skip to content

[BUG] cell.text return an empty object when cell is empty  #1299

@Deliay

Description

@Deliay

🐛 Bug Report

cell.text return an empty object when cell is empty

Lib version: 3.9.0

Steps To Reproduce

const wb = new ExcelJS.Workbook();
const ws = wb.addWorksheet('XYZ');
ws.getCell('A1').value = { richText: [] };

// cell.text equal '',  now value is correct
expect(cell.text).to.equal('');
await wb.xlsx.writeFile('test.xlsx');

// persiste to file then create new Workbook and read saved file will reproduce this BUG
const wb2 = new ExcelJS.Workbook();
await wb2.xlsx.readFile('test.xlsx')
const cell2= wb.getWorksheet('XYZ').getCell('A1').

// cell.text now is {}, expect ''
expect(cell2.text).to.equal({});

The expected behaviour:

expect(cell2.text).to.equal('');

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions