fixed attribute
This commit is contained in:
@ -28,6 +28,7 @@ describe("ThematicBreak", () => {
|
||||
val: "single",
|
||||
sz: "6"
|
||||
};
|
||||
delete newJson.pBdr[0].bottom[0]._attrs.xmlKeys;
|
||||
assert(JSON.stringify(newJson.pBdr[0].bottom[0]._attrs) === JSON.stringify(attributes));
|
||||
});
|
||||
})
|
||||
|
@ -26,11 +26,16 @@ describe("Formatter", () => {
|
||||
var paragraph = new docx.Paragraph();
|
||||
var newJson = formatter.format(paragraph);
|
||||
newJson = jsonify(newJson);
|
||||
console.log(JSON.stringify(newJson, null, " "));
|
||||
|
||||
assert.isDefined(newJson["w:p"]);
|
||||
});
|
||||
|
||||
it("should remove xmlKeys", () => {
|
||||
var paragraph = new docx.Paragraph();
|
||||
var newJson = formatter.format(paragraph);
|
||||
var stringifiedJson = JSON.stringify(newJson);
|
||||
assert(stringifiedJson.indexOf("xmlKeys") < 0);
|
||||
});
|
||||
|
||||
it("should format simple paragraph with bold text", () => {
|
||||
var paragraph = new docx.Paragraph();
|
||||
paragraph.addText(new docx.TextRun("test").bold());
|
||||
@ -62,14 +67,14 @@ describe("Formatter", () => {
|
||||
assert.isDefined(newJson["w:p"]);
|
||||
});
|
||||
|
||||
it.only("should format Properties object correctly", () => {
|
||||
it("should format Properties object correctly", () => {
|
||||
var properties = new Properties({
|
||||
title: "test document",
|
||||
creator: "Dolan"
|
||||
});
|
||||
var newJson = formatter.format(properties);
|
||||
newJson = jsonify(newJson);
|
||||
console.log(JSON.stringify(newJson, null, " "));
|
||||
assert.isDefined(newJson["cp:coreProperties"]);
|
||||
});
|
||||
});
|
||||
});
|
@ -1,17 +1,22 @@
|
||||
/// <reference path="../typings/mocha/mocha.d.ts" />
|
||||
/// <reference path="../typings/chai/chai.d.ts" />
|
||||
/// <reference path="../typings/archiver/archiver.d.ts" />
|
||||
/// <reference path="../typings/xml/xml.d.ts" />
|
||||
|
||||
import {LocalPacker} from "../export/packer/local";
|
||||
import {assert} from "chai";
|
||||
import {Document} from "../docx/document"
|
||||
import {Properties} from "../properties"
|
||||
|
||||
describe("Packer", () => {
|
||||
describe.only("Packer", () => {
|
||||
var packer: LocalPacker;
|
||||
|
||||
beforeEach(() => {
|
||||
var document = new Document();
|
||||
packer = new LocalPacker(document, "build/tests/test.zip");
|
||||
var properties = new Properties({
|
||||
title: "test document"
|
||||
});
|
||||
packer = new LocalPacker(document, undefined, properties, "build/tests/test.zip");
|
||||
});
|
||||
|
||||
describe('#pack()', () => {
|
||||
|
Reference in New Issue
Block a user