2023-06-05 00:33:43 +01:00
|
|
|
import { describe, expect, it } from "vitest";
|
2019-01-15 21:40:19 +00:00
|
|
|
|
2022-06-26 23:26:42 +01:00
|
|
|
import { Formatter } from "@export/formatter";
|
2019-01-15 21:40:19 +00:00
|
|
|
|
2023-12-29 23:52:43 +00:00
|
|
|
import { CurrentSection, NumberOfPages, NumberOfPagesSection, Page } from "./page-number";
|
2019-01-15 21:40:19 +00:00
|
|
|
|
|
|
|
describe("Page", () => {
|
|
|
|
describe("#constructor()", () => {
|
2023-12-29 23:52:43 +00:00
|
|
|
it("should work", () => {
|
2019-01-15 21:40:19 +00:00
|
|
|
const tree = new Formatter().format(new Page());
|
|
|
|
expect(tree).to.deep.equal({ "w:instrText": [{ _attr: { "xml:space": "preserve" } }, "PAGE"] });
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
describe("NumberOfPages", () => {
|
|
|
|
describe("#constructor()", () => {
|
2023-12-29 23:52:43 +00:00
|
|
|
it("should work", () => {
|
2019-01-15 21:40:19 +00:00
|
|
|
const tree = new Formatter().format(new NumberOfPages());
|
|
|
|
expect(tree).to.deep.equal({ "w:instrText": [{ _attr: { "xml:space": "preserve" } }, "NUMPAGES"] });
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
2019-08-09 11:56:22 +03:00
|
|
|
|
|
|
|
describe("NumberOfPagesSection", () => {
|
|
|
|
describe("#constructor()", () => {
|
2023-12-29 23:52:43 +00:00
|
|
|
it("should work", () => {
|
2019-08-09 11:56:22 +03:00
|
|
|
const tree = new Formatter().format(new NumberOfPagesSection());
|
|
|
|
expect(tree).to.deep.equal({ "w:instrText": [{ _attr: { "xml:space": "preserve" } }, "SECTIONPAGES"] });
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
2023-12-29 23:52:43 +00:00
|
|
|
|
|
|
|
describe("CurrentSection", () => {
|
|
|
|
describe("#constructor()", () => {
|
|
|
|
it("should work", () => {
|
|
|
|
const tree = new Formatter().format(new CurrentSection());
|
|
|
|
expect(tree).to.deep.equal({ "w:instrText": [{ _attr: { "xml:space": "preserve" } }, "SECTION"] });
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|