Change docx folder to more appropriate "file" folder

This commit is contained in:
Dolan
2017-12-20 01:03:20 +00:00
parent 43ebfe7a2f
commit 2358139a6b
117 changed files with 22 additions and 23 deletions

View File

@ -1,9 +1,9 @@
import { assert } from "chai";
import * as docx from "../docx";
import { Properties } from "../docx/properties";
import { Attributes } from "../docx/xml-components";
import { Formatter } from "../export/formatter";
import * as file from "../file";
import { Properties } from "../file/properties";
import { Attributes } from "../file/xml-components";
import { Utility } from "../tests/utility";
describe("Formatter", () => {
@ -15,21 +15,21 @@ describe("Formatter", () => {
describe("#format()", () => {
it("should format simple paragraph", () => {
const paragraph = new docx.Paragraph();
const paragraph = new file.Paragraph();
const newJson = formatter.format(paragraph);
assert.isDefined(newJson["w:p"]);
});
it("should remove xmlKeys", () => {
const paragraph = new docx.Paragraph();
const paragraph = new file.Paragraph();
const newJson = formatter.format(paragraph);
const stringifiedJson = JSON.stringify(newJson);
assert(stringifiedJson.indexOf("xmlKeys") < 0);
});
it("should format simple paragraph with bold text", () => {
const paragraph = new docx.Paragraph();
paragraph.addRun(new docx.TextRun("test").bold());
const paragraph = new file.Paragraph();
paragraph.addRun(new file.TextRun("test").bold());
const newJson = formatter.format(paragraph);
assert.isDefined(newJson["w:p"][1]["w:r"][0]["w:rPr"][0]["w:b"][0]._attr["w:val"]);
});
@ -61,7 +61,7 @@ describe("Formatter", () => {
});
it("should should change 'p' tag into 'w:p' tag", () => {
const paragraph = new docx.Paragraph();
const paragraph = new file.Paragraph();
const newJson = formatter.format(paragraph);
assert.isDefined(newJson["w:p"]);
});