Remove usage of Utility class

This commit is contained in:
Dolan
2019-06-26 22:12:18 +01:00
parent 564a055316
commit a531713214
11 changed files with 182 additions and 99 deletions

View File

@ -1,6 +1,6 @@
import { assert } from "chai";
import { expect } from "chai";
import { Utility } from "tests/utility";
import { Formatter } from "export/formatter";
import { Style } from "./style";
@ -10,14 +10,26 @@ describe("ParagraphStyle", () => {
describe("#constructor()", () => {
it("should create a style with given value", () => {
style = new Style("test");
const newJson = Utility.jsonify(style);
assert.equal(newJson.root[0].root.val, "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 newJson = Utility.jsonify(style);
assert.equal(newJson.root[0].root.val, "");
const tree = new Formatter().format(style);
expect(tree).to.deep.equal({
"w:pStyle": {
_attr: {
"w:val": "",
},
},
});
});
});
});