sync: update from private repo (6fcb0d0)
This commit is contained in:
@@ -358,4 +358,27 @@ describe('Read* tools — format mismatch rejection (issue #246)', () => {
|
||||
expect(result?.isError).toBe(false);
|
||||
expect(result?.output).toContain('Sheet1');
|
||||
});
|
||||
|
||||
it('ReadExcel includes a Styles section only when include_styles=true', async () => {
|
||||
workspacePath = makeWorkspace();
|
||||
fs.mkdirSync(path.join(workspacePath, 'input'), { recursive: true });
|
||||
|
||||
const ExcelJS = (await import('exceljs')).default;
|
||||
const wb = new ExcelJS.Workbook();
|
||||
const ws = wb.addWorksheet('Sheet1');
|
||||
ws.getCell('A1').value = 'Header';
|
||||
ws.getCell('A1').fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FFFFF2CC' } };
|
||||
ws.getCell('A1').font = { bold: true };
|
||||
await wb.xlsx.writeFile(path.join(workspacePath, 'input', 'styled.xlsx'));
|
||||
|
||||
// Without include_styles: no Styles section (backward compat)
|
||||
const plain = await executeTool('ReadExcel', { path: 'input/styled.xlsx' }, makeContext(workspacePath));
|
||||
expect(plain!.output).not.toContain('### Styles');
|
||||
|
||||
// With include_styles: Styles section present with fill color and font bold
|
||||
const styled = await executeTool('ReadExcel', { path: 'input/styled.xlsx', include_styles: true }, makeContext(workspacePath));
|
||||
expect(styled!.output).toContain('### Styles');
|
||||
expect(styled!.output).toContain('#FFF2CC');
|
||||
expect(styled!.output).toMatch(/bold/);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user