Add more tests
This commit is contained in:
@ -70,18 +70,7 @@ describe("ParagraphProperties", () => {
|
|||||||
const properties = new ParagraphProperties({
|
const properties = new ParagraphProperties({
|
||||||
widowControl: true,
|
widowControl: true,
|
||||||
});
|
});
|
||||||
const tree = new Formatter().format(properties, {
|
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: {} }),
|
|
||||||
});
|
|
||||||
|
|
||||||
expect(tree).to.deep.equal({
|
expect(tree).to.deep.equal({
|
||||||
"w:pPr": [
|
"w:pPr": [
|
||||||
@ -92,22 +81,11 @@ describe("ParagraphProperties", () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should create with bidirectional", () => {
|
it("should create with the bidirectional property", () => {
|
||||||
const properties = new ParagraphProperties({
|
const properties = new ParagraphProperties({
|
||||||
bidirectional: true,
|
bidirectional: true,
|
||||||
});
|
});
|
||||||
const tree = new Formatter().format(properties, {
|
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: {} }),
|
|
||||||
});
|
|
||||||
|
|
||||||
expect(tree).to.deep.equal({
|
expect(tree).to.deep.equal({
|
||||||
"w:pPr": [
|
"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": {},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user