Files
docx-js/src/file/paragraph/links/pageref-field-instruction.spec.ts
Thomas Gerbet 3f257bf5a4 Add the pageref element
This instruction is useful if you want to get the number of the page
containing a specific bookmark.
2021-08-03 21:17:32 +02:00

25 lines
784 B
TypeScript

import { expect } from "chai";
import { Formatter } from "export/formatter";
import { PageRefFieldInstruction } from "./pageref-field-instruction";
describe("PageRef field instruction", () => {
describe("#constructor()", () => {
it("should construct a pageref field instruction without options", () => {
const instruction = new PageRefFieldInstruction("anchor");
const tree = new Formatter().format(instruction);
expect(tree).to.be.deep.equal({
"w:instrText": [
{
_attr: {
"xml:space": "preserve",
},
},
"PAGEREF anchor",
],
});
});
});
});