remove more duplicate classes; add additional values functions; clean up tests

This commit is contained in:
Tom Hunkapiller
2021-05-24 11:28:10 +03:00
parent a56119e7cd
commit ce2a0fb864
38 changed files with 311 additions and 362 deletions

View File

@ -416,7 +416,7 @@ describe("Paragraph", () => {
});
describe("#contextualSpacing()", () => {
it("should add contextualSpacing to JSON, and set 1 if true", () => {
it("should add contextualSpacing", () => {
const paragraph = new Paragraph({
contextualSpacing: true,
});
@ -424,7 +424,20 @@ describe("Paragraph", () => {
expect(tree).to.deep.equal({
"w:p": [
{
"w:pPr": [{ "w:contextualSpacing": { _attr: { "w:val": 1 } } }],
"w:pPr": [{ "w:contextualSpacing": {} }],
},
],
});
});
it("should remove contextualSpacing", () => {
const paragraph = new Paragraph({
contextualSpacing: false,
});
const tree = new Formatter().format(paragraph);
expect(tree).to.deep.equal({
"w:p": [
{
"w:pPr": [{ "w:contextualSpacing": { _attr: { "w:val": false } } }],
},
],
});