feat: 完成 DOCX 通用结构映射与严格收口
This commit is contained in:
@@ -178,6 +178,31 @@ describe("DOCX 主题令牌归一化", () => {
|
||||
expect(tokens.slots).toHaveLength(DOCX_STYLE_SLOT_NAMES.length);
|
||||
});
|
||||
|
||||
it("按 border-box 文档的内容区宽度归一化全宽表格", () => {
|
||||
const tokens = resolveDocxThemeTokens({
|
||||
snapshot: createSnapshot({
|
||||
document: {
|
||||
width: "790px",
|
||||
paddingLeft: "30px",
|
||||
paddingRight: "30px",
|
||||
borderLeft: "0px none rgb(17, 34, 51)",
|
||||
borderRight: "0px none rgb(17, 34, 51)"
|
||||
},
|
||||
table: {
|
||||
width: "730px"
|
||||
}
|
||||
}),
|
||||
config: {
|
||||
mode: "auto",
|
||||
basePreset: "general",
|
||||
overrides: {},
|
||||
legacyPreset: false
|
||||
}
|
||||
});
|
||||
|
||||
expect(findSlot(tokens, "table").style.widthPercent).toBe(100);
|
||||
});
|
||||
|
||||
it("保留封面高度、垂直对齐、轮廓线和隐藏字段语义", () => {
|
||||
const tokens = resolveDocxThemeTokens({
|
||||
snapshot: createSnapshot({
|
||||
|
||||
Reference in New Issue
Block a user