Change docx folder to more appropriate "file" folder
This commit is contained in:
41
src/file/paragraph/formatting/border.spec.ts
Normal file
41
src/file/paragraph/formatting/border.spec.ts
Normal file
@ -0,0 +1,41 @@
|
||||
import { assert } from "chai";
|
||||
|
||||
import { Utility } from "../../../tests/utility";
|
||||
import { ThematicBreak } from "./border";
|
||||
|
||||
describe("Border", () => {
|
||||
// TODO: Need tests here
|
||||
});
|
||||
|
||||
describe("ThematicBreak", () => {
|
||||
let thematicBreak: ThematicBreak;
|
||||
|
||||
beforeEach(() => {
|
||||
thematicBreak = new ThematicBreak();
|
||||
});
|
||||
|
||||
describe("#constructor()", () => {
|
||||
it("should create valid JSON", () => {
|
||||
const stringifiedJson = JSON.stringify(thematicBreak);
|
||||
let newJson;
|
||||
|
||||
try {
|
||||
newJson = JSON.parse(stringifiedJson);
|
||||
} catch (e) {
|
||||
assert.isTrue(false);
|
||||
}
|
||||
assert.isTrue(true);
|
||||
});
|
||||
|
||||
it("should create a Thematic Break with correct border properties", () => {
|
||||
const newJson = Utility.jsonify(thematicBreak);
|
||||
const attributes = {
|
||||
color: "auto",
|
||||
space: "1",
|
||||
val: "single",
|
||||
sz: "6",
|
||||
};
|
||||
assert.equal(JSON.stringify(newJson.root[0].root[0].root), JSON.stringify(attributes));
|
||||
});
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user