Add more tests

This commit is contained in:
Dolan Miu
2021-12-02 17:27:00 +00:00
parent 74fbc715e9
commit 5ad7fd8a15

View File

@ -70,18 +70,7 @@ describe("ParagraphProperties", () => {
const properties = new ParagraphProperties({
widowControl: true,
});
const tree = new Formatter().format(properties, {
// tslint:disable-next-line: no-object-literal-type-assertion
file: {
Numbering: {
createConcreteNumberingInstance: (_: string, __: number) => {
return;
},
},
} as File,
// tslint:disable-next-line: no-object-literal-type-assertion
viewWrapper: new DocumentWrapper({ background: {} }),
});
const tree = new Formatter().format(properties);
expect(tree).to.deep.equal({
"w:pPr": [
@ -92,22 +81,11 @@ describe("ParagraphProperties", () => {
});
});
it("should create with bidirectional", () => {
it("should create with the bidirectional property", () => {
const properties = new ParagraphProperties({
bidirectional: true,
});
const tree = new Formatter().format(properties, {
// tslint:disable-next-line: no-object-literal-type-assertion
file: {
Numbering: {
createConcreteNumberingInstance: (_: string, __: number) => {
return;
},
},
} as File,
// tslint:disable-next-line: no-object-literal-type-assertion
viewWrapper: new DocumentWrapper({ background: {} }),
});
const tree = new Formatter().format(properties);
expect(tree).to.deep.equal({
"w:pPr": [
@ -117,5 +95,35 @@ describe("ParagraphProperties", () => {
],
});
});
it("should create with the contextualSpacing property", () => {
const properties = new ParagraphProperties({
contextualSpacing: true,
});
const tree = new Formatter().format(properties);
expect(tree).to.deep.equal({
"w:pPr": [
{
"w:contextualSpacing": {},
},
],
});
});
it("should create with the suppressLineNumbers property", () => {
const properties = new ParagraphProperties({
suppressLineNumbers: true,
});
const tree = new Formatter().format(properties);
expect(tree).to.deep.equal({
"w:pPr": [
{
"w:suppressLineNumbers": {},
},
],
});
});
});
});