sync: update from private repo (6fcb0d0)

This commit is contained in:
oss-sync
2026-06-04 03:03:12 +00:00
parent 21be01b699
commit 57685d995c
36 changed files with 2467 additions and 391 deletions
+23
View File
@@ -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/);
});
});