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

@ -2,7 +2,7 @@ import { expect } from "chai";
import { Formatter } from "export/formatter";
import { ContextualSpacing, Spacing } from "./spacing";
import { Spacing } from "./spacing";
describe("Spacing", () => {
describe("#constructor", () => {
@ -23,23 +23,3 @@ describe("Spacing", () => {
});
});
});
describe("ContextualSpacing", () => {
describe("#constructor", () => {
it("should create", () => {
const spacing = new ContextualSpacing(true);
const tree = new Formatter().format(spacing);
expect(tree).to.deep.equal({
"w:contextualSpacing": { _attr: { "w:val": 1 } },
});
});
it("should create with value of 0 if param is false", () => {
const spacing = new ContextualSpacing(false);
const tree = new Formatter().format(spacing);
expect(tree).to.deep.equal({
"w:contextualSpacing": { _attr: { "w:val": 0 } },
});
});
});
});