Files
docx-js/src/file/paragraph/formatting/spacing.spec.ts

26 lines
871 B
TypeScript
Raw Normal View History

2023-06-05 00:33:43 +01:00
import { describe, expect, it } from "vitest";
import { Formatter } from "@export/formatter";
2018-10-26 01:04:07 +01:00
import { Spacing } from "./spacing";
describe("Spacing", () => {
describe("#constructor", () => {
it("should set the properties given", () => {
2018-01-23 01:33:12 +00:00
const spacing = new Spacing({ before: 100, after: 120, line: 150 });
const tree = new Formatter().format(spacing);
expect(tree).to.deep.equal({
"w:spacing": { _attr: { "w:after": 120, "w:before": 100, "w:line": 150 } },
});
});
it("should only set the given properties", () => {
2018-01-23 01:33:12 +00:00
const spacing = new Spacing({ before: 100 });
const tree = new Formatter().format(spacing);
expect(tree).to.deep.equal({
"w:spacing": { _attr: { "w:before": 100 } },
});
});
});
});