2021-03-13 20:23:15 +00:00
|
|
|
import { expect } from "chai";
|
|
|
|
|
2022-06-26 23:26:42 +01:00
|
|
|
import { Formatter } from "@export/formatter";
|
2021-03-13 20:23:15 +00:00
|
|
|
|
2021-05-24 08:20:08 +03:00
|
|
|
import { CharacterSpacing, Color } from "./formatting";
|
2021-03-13 20:23:15 +00:00
|
|
|
|
2021-05-24 08:20:08 +03:00
|
|
|
describe("CharacterSpacing", () => {
|
2021-03-13 20:23:15 +00:00
|
|
|
describe("#constructor()", () => {
|
|
|
|
it("should create", () => {
|
2021-05-24 08:20:08 +03:00
|
|
|
const element = new CharacterSpacing(32);
|
2021-03-13 20:23:15 +00:00
|
|
|
|
2021-05-24 08:20:08 +03:00
|
|
|
const tree = new Formatter().format(element);
|
2021-03-13 20:23:15 +00:00
|
|
|
expect(tree).to.deep.equal({
|
2021-05-24 08:20:08 +03:00
|
|
|
"w:spacing": {
|
2021-03-13 20:23:15 +00:00
|
|
|
_attr: {
|
2021-05-24 08:20:08 +03:00
|
|
|
"w:val": 32,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
describe("Color", () => {
|
|
|
|
describe("#constructor()", () => {
|
|
|
|
it("should create", () => {
|
|
|
|
const element = new Color("#FFFFFF");
|
|
|
|
|
|
|
|
const tree = new Formatter().format(element);
|
|
|
|
expect(tree).to.deep.equal({
|
|
|
|
"w:color": {
|
|
|
|
_attr: {
|
|
|
|
"w:val": "FFFFFF",
|
2021-03-13 20:23:15 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|