2019-06-26 22:12:18 +01:00
|
|
|
import { expect } from "chai";
|
2017-09-17 00:00:41 +01:00
|
|
|
|
2022-06-26 23:26:42 +01:00
|
|
|
import { Formatter } from "@export/formatter";
|
2018-10-26 01:04:07 +01:00
|
|
|
|
2017-09-17 00:00:41 +01:00
|
|
|
import { Style } from "./style";
|
2016-03-30 02:55:11 +01:00
|
|
|
|
2016-04-09 04:53:42 +01:00
|
|
|
describe("ParagraphStyle", () => {
|
2016-05-26 15:08:34 +01:00
|
|
|
let style: Style;
|
2016-03-30 02:55:11 +01:00
|
|
|
|
|
|
|
describe("#constructor()", () => {
|
|
|
|
it("should create a style with given value", () => {
|
|
|
|
style = new Style("test");
|
2019-06-26 22:12:18 +01:00
|
|
|
const tree = new Formatter().format(style);
|
|
|
|
expect(tree).to.deep.equal({
|
|
|
|
"w:pStyle": {
|
|
|
|
_attr: {
|
|
|
|
"w:val": "test",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
});
|
2016-03-30 02:55:11 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
it("should create a style with blank val", () => {
|
|
|
|
style = new Style("");
|
2019-06-26 22:12:18 +01:00
|
|
|
const tree = new Formatter().format(style);
|
|
|
|
expect(tree).to.deep.equal({
|
|
|
|
"w:pStyle": {
|
|
|
|
_attr: {
|
|
|
|
"w:val": "",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
});
|
2016-03-30 02:55:11 +01:00
|
|
|
});
|
|
|
|
});
|
2017-03-09 22:31:55 +00:00
|
|
|
});
|