Add tests
This commit is contained in:
@ -2,7 +2,7 @@ import { expect } from "chai";
|
||||
|
||||
import { Formatter } from "export/formatter";
|
||||
|
||||
import { Spacing } from "./spacing";
|
||||
import { ContextualSpacing, Spacing } from "./spacing";
|
||||
|
||||
describe("Spacing", () => {
|
||||
describe("#constructor", () => {
|
||||
@ -23,3 +23,23 @@ 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 } }],
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user