diff --git a/src/file/file.spec.ts b/src/file/file.spec.ts index 6ec30e1be9..9b93a63db1 100644 --- a/src/file/file.spec.ts +++ b/src/file/file.spec.ts @@ -5,7 +5,7 @@ import { Formatter } from "export/formatter"; import { File } from "./file"; import { Footer, Header } from "./header"; -import { HyperlinkRef, Paragraph } from "./paragraph"; +import { HyperlinkRef, HyperlinkType, Paragraph } from "./paragraph"; import { Table, TableCell, TableRow } from "./table"; import { TableOfContents } from "./table-of-contents"; @@ -243,12 +243,40 @@ describe("File", () => { }); }); + describe("#addTrackRevisionsFeature", () => { + it("should call the underlying document's add", () => { + const file = new File({ + features: { + trackRevisions: true, + }, + }); + + // tslint:disable-next-line: no-unused-expression no-string-literal + expect(file.Settings["trackRevisions"]).to.exist; + }); + }); + describe("#HyperlinkCache", () => { it("should initially have empty hyperlink cache", () => { const file = new File(); expect(file.HyperlinkCache).to.deep.equal({}); }); + + it("should have hyperlink cache when option is added", () => { + const file = new File({ + hyperlinks: { + myCoolLink: { + link: "http://www.example.com", + text: "Hyperlink", + type: HyperlinkType.EXTERNAL, + }, + }, + }); + + // tslint:disable-next-line: no-unused-expression no-string-literal + expect(file.HyperlinkCache["myCoolLink"]).to.exist; + }); }); describe("#createFootnote", () => {