Change docx folder to more appropriate "file" folder
This commit is contained in:
@ -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"]);
|
||||
});
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { BaseXmlComponent } from "../docx/xml-components";
|
||||
import { IXmlableObject } from "../docx/xml-components/xmlable-object";
|
||||
import { BaseXmlComponent } from "../file/xml-components";
|
||||
import { IXmlableObject } from "../file/xml-components/xmlable-object";
|
||||
|
||||
export class Formatter {
|
||||
public format(input: BaseXmlComponent): IXmlableObject {
|
||||
|
@ -4,7 +4,7 @@ import * as fs from "fs";
|
||||
import * as path from "path";
|
||||
import * as xml from "xml";
|
||||
|
||||
import { File } from "../../docx";
|
||||
import { File } from "../../file";
|
||||
import { Formatter } from "../formatter";
|
||||
|
||||
const TEMPLATE_PATH = path.resolve(__dirname, "../../../template");
|
||||
|
@ -1,6 +1,6 @@
|
||||
import * as express from "express";
|
||||
|
||||
import { File } from "../../docx";
|
||||
import { File } from "../../file";
|
||||
import { Compiler } from "./compiler";
|
||||
import { IPacker } from "./packer";
|
||||
|
||||
|
@ -1,9 +1,8 @@
|
||||
/* tslint:disable:typedef space-before-function-paren */
|
||||
import * as fs from "fs";
|
||||
|
||||
import { File } from "../../docx";
|
||||
import { Paragraph } from "../../docx/paragraph";
|
||||
import { LocalPacker } from "../../export/packer/local";
|
||||
import { File, Paragraph } from "../../file";
|
||||
|
||||
describe("LocalPacker", () => {
|
||||
let packer: LocalPacker;
|
||||
|
@ -2,7 +2,7 @@ import * as fs from "fs";
|
||||
import * as os from "os";
|
||||
import * as path from "path";
|
||||
|
||||
import { File } from "../../docx";
|
||||
import { File } from "../../file";
|
||||
import { Compiler } from "./compiler";
|
||||
import { IPacker } from "./packer";
|
||||
import { PdfConvertWrapper } from "./pdf-convert-wrapper";
|
||||
|
Reference in New Issue
Block a user