Files
docx-js/src/file/paragraph/formatting/style.spec.ts
Dolan Miu 982d923553 Improve import alias
@file/ and @export/ instead of file/ and export/ etc
2022-06-26 23:26:42 +01:00

36 lines
948 B
TypeScript

import { expect } from "chai";
import { Formatter } from "@export/formatter";
import { Style } from "./style";
describe("ParagraphStyle", () => {
let style: Style;
describe("#constructor()", () => {
it("should create a style with given value", () => {
style = new Style("test");
const tree = new Formatter().format(style);
expect(tree).to.deep.equal({
"w:pStyle": {
_attr: {
"w:val": "test",
},
},
});
});
it("should create a style with blank val", () => {
style = new Style("");
const tree = new Formatter().format(style);
expect(tree).to.deep.equal({
"w:pStyle": {
_attr: {
"w:val": "",
},
},
});
});
});
});