ability to specify textDirection for section
This commit is contained in:
@ -11,6 +11,7 @@ import { VerticalAlign } from "file/vertical-align";
|
||||
import { PageOrientation } from "./properties";
|
||||
import { LineNumberRestartFormat } from "./properties/line-number";
|
||||
import { PageBorderOffsetFrom } from "./properties/page-borders";
|
||||
import { PageTextDirection } from "./properties/page-text-direction";
|
||||
import { SectionType } from "./properties/section-type";
|
||||
import { sectionMarginDefaults, sectionPageSizeDefaults, SectionProperties } from "./section-properties";
|
||||
|
||||
@ -258,5 +259,19 @@ describe("SectionProperties", () => {
|
||||
"w:lnNumType": { _attr: { "w:countBy": 2, "w:distance": 4, "w:restart": "continuous", "w:start": 2 } },
|
||||
});
|
||||
});
|
||||
|
||||
it("should create section properties with text flow direction", () => {
|
||||
const properties = new SectionProperties({
|
||||
page: {
|
||||
textDirection: PageTextDirection.TOP_TO_BOTTOM_RIGHT_TO_LEFT,
|
||||
},
|
||||
});
|
||||
const tree = new Formatter().format(properties);
|
||||
expect(Object.keys(tree)).to.deep.equal(["w:sectPr"]);
|
||||
const type = tree["w:sectPr"].find((item) => item["w:textDirection"] !== undefined);
|
||||
expect(type).to.deep.equal({
|
||||
"w:textDirection": { _attr: { "w:val": "tbRl" } },
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user