Release Office Tools 0.2.0
Verify / verify (push) Canceled after 0s

This commit is contained in:
2026-09-02 07:32:31 +02:00
parent a5524e27e3
commit 08b8f84f7b
50 changed files with 2196 additions and 165 deletions
+50
View File
@@ -254,4 +254,54 @@ describe("OpenDocument normalized models", () => {
expect(document.format).toBe("odt");
expect(document.warnings).toContain("Package has no META-INF/manifest.xml");
});
it("retains page geometry, default styles, comments and spreadsheet column metadata", () => {
const styles = `<?xml version="1.0"?><office:document-styles ${XMLNS}>
<office:styles><style:default-style style:family="paragraph"><style:text-properties fo:color="#123456"/></style:default-style></office:styles>
<office:automatic-styles><style:page-layout style:name="pm1"><style:page-layout-properties fo:page-width="21cm" fo:page-height="29.7cm"/></style:page-layout></office:automatic-styles>
</office:document-styles>`;
const odt = parseOdt(
makeOdf(
"odt",
odtContent(
`<text:p>Reviewed<office:annotation office:name="c1"><dc:creator>Ada</dc:creator><dc:date>2026-09-01</dc:date><text:p>Looks good</text:p></office:annotation></text:p>`,
),
{ styles },
),
);
expect(odt.pageWidth).toMatchObject({ value: 21, unit: "cm" });
expect(odt.styles).toEqual(
expect.arrayContaining([
expect.objectContaining({ isDefault: true, family: "paragraph" }),
]),
);
expect(odt.annotations[0]).toMatchObject({
id: "c1",
creator: "Ada",
createdAt: "2026-09-01",
blocks: [expect.objectContaining({ text: "Looks good" })],
});
const ods = parseOds(
makeOdf(
"ods",
odsContent(`<table:table table:name="Columns" table:visibility="collapse">
<table:table-column table:number-columns-repeated="3" table:style-name="Wide" table:default-cell-style-name="Money"/>
<table:table-row table:default-cell-style-name="RowDefault"><table:table-cell office:value-type="string"><text:p>x</text:p></table:table-cell></table:table-row>
</table:table>`),
),
);
expect(ods.sheets[0]).toMatchObject({
visibility: "collapse",
columns: [
{
index: 0,
repeat: 3,
styleName: "Wide",
defaultCellStyleName: "Money",
},
],
rows: [expect.objectContaining({ defaultCellStyleName: "RowDefault" })],
});
});
});