update file/document and section-properties

This commit is contained in:
Tom Hunkapiller
2021-05-25 03:41:12 +03:00
parent e198f0752a
commit 63cea76eac
54 changed files with 861 additions and 659 deletions

View File

@ -1,11 +1,18 @@
import { expect } from "chai";
import { Formatter } from "export/formatter";
import { sectionMarginDefaults, sectionPageSizeDefaults } from "./document";
import { File } from "./file";
import { Footer, Header } from "./header";
import { Paragraph } from "./paragraph";
const PAGE_SIZE_DEFAULTS = {
"w:h": sectionPageSizeDefaults.HEIGHT,
"w:orient": sectionPageSizeDefaults.ORIENTATION,
"w:w": sectionPageSizeDefaults.WIDTH,
};
describe("File", () => {
describe("#constructor", () => {
it("should create with correct headers and footers", () => {
@ -114,23 +121,19 @@ describe("File", () => {
"w:sectPr": [
{
"w:pgSz": {
_attr: {
"w:h": 16838,
"w:orient": "portrait",
"w:w": 11906,
},
_attr: PAGE_SIZE_DEFAULTS,
},
},
{
"w:pgMar": {
_attr: {
"w:bottom": 1440,
"w:footer": 708,
"w:gutter": 0,
"w:header": 708,
"w:left": 1440,
"w:right": 1440,
"w:top": 1440,
"w:bottom": sectionMarginDefaults.BOTTOM,
"w:footer": sectionMarginDefaults.FOOTER,
"w:gutter": sectionMarginDefaults.GUTTER,
"w:header": sectionMarginDefaults.HEADER,
"w:left": sectionMarginDefaults.LEFT,
"w:right": sectionMarginDefaults.RIGHT,
"w:top": sectionMarginDefaults.TOP,
},
},
},
@ -139,15 +142,15 @@ describe("File", () => {
_attr: {},
},
},
{
"w:cols": {
_attr: {
"w:num": 1,
"w:sep": false,
"w:space": 708,
},
},
},
// {
// "w:cols": {
// _attr: {
// "w:num": 1,
// "w:sep": false,
// "w:space": 708,
// },
// },
// },
{
"w:docGrid": {
_attr: {